Upgrade Java for the CLI on Mac OS X

I was screwing around for too long with various installers on my Mac, trying to get the latest available Java runtime working from my terminal.

Finally, some kind soul on StackExchange I think mentioned that if you want to get Java on the command line working, you have to install the JDK package, even if all you need is a JRE. Thanks, Obama!

Anyway, after installing the package from Oracle, now all is well.

Multi-page PDF to multiple images

Prefix that with gm if you’re running GraphicsMagick rather than ImageMagick.

The %d part means that a number should be placed there to indicate the page number from the original that the image file contains. So a three-page PDF will produce

You can get a better default sort order on the files by telling *magick to zero-prefix the number with a slight change to the format string. So changing %d to %03d will starting numbering at 000.

You should be able to generate any image file type that *magick supports by just specifying the destination extension (jpg, png, gif, etc.).

join: the command

From the manual:

I had two CSVs, baz01.csv and baz02.csv. They shared the same first column, which was a list of database table names. The second column contained the number of rows from each table. The row numbers between the two files were different, and I wanted to compare them. The join command to the rescue!

gave me exactly what I wanted: the output contains the first identical column from both files, followed by column 2 of the baz01.csv, followed by the second column of baz02.csv, followed by the third column minus the second.

Of course, this will only work on the simplest CSV files, meaning no escaped or quoted commas allowed.