Copying a long output from the console

January 15th, 2016 - Bonn

Let’s say that you want to copy paste the list of countries in ISO3166 format from a gem, you get an output like this in the console, where you can only see the first elements

I’ve found myself copying chunks on the output manually, one trick in some cases is just to make the console font smaller

You could also create a more compact string joining the array with some character and then unpack it on a editor replacing those characters. Sometimes this trick also helps, to copy the contents to the clipboard, although some format is lost.

`echo #{ISO3166::Country.all} | pbcopy`