It would be nice to have a machine readable copy of the UK National rail timetable. Network rail supply a timetable in PDF format. It is possible to extract machine readable timetable data from this PDF.

Requirements

Usage

Put CompleteTimetable.pdf in a directory with parse. Run parse: perl parse The first time it is run it will call pdftops to convert the PDF, a binary format, into PostScript, a text format, which is easy to work with.

Then it will print lots of debugging output about pages, timetables and trains.

Output

Here is an sample of output in a range of formats:

Further work

This code is unfinished, lots of cases are not handled. Specifically: