[nzlug] Post Codes

Shane shane at weasel.is-a-geek.net
Fri Sep 1 08:43:49 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


(gah I thought I had fixed the profile for this folder in kmail, apologies if 
this doubles up)




More information about the NZLUG mailing list