[nzlug] Post Codes

Shane shane at shanes.dyndns.org
Fri Sep 1 08:41:29 NZST 2006


On Friday 01 September 2006 08:02, ronw at paradise.net.nz wrote:
> NZ Post have finally issued the new postcodes in a downloadabel pdf format.
> I would like to be able to scrape the pdf file and get data into a
> database. Anyone have any ideas on how best to rip the data out of the pdf
> and into a file. The pdf is 555 pages long and of course there is other
> rubbish on the page like headers etc.
> Thanks
>
>
> -
> Ron Wilson

Failing Simons suggestion (I couldnt find the csv file) You can use pdftotext 
usage:
$pdftotext -layout postcodedirectory_nomaps.pdf postcodedirectory_nomaps.txt

which will give you a (rather large) file you can grep, run regexp on, or 
w/ever takes your fancy




More information about the NZLUG mailing list