James Jefferies and ShedCode Ltd

The world of James and ShedCode

Parse Train Describer CSV Data

| Comments

If you are using the Network Rail Open Data Feeds, then hopefully you’ve had a look at the fantastic wiki started by poggs.

In the reference data section, it provides a link to a CSV file which poggs is sharing containing Train Describer berths.

I wanted to parse that data using a simple ruby script and get it in to my mongo database.

You can use the mongoimport program to pull in the CSV by adding a header file, or you can use this little ruby script I wrote (with a lot of help from this snippet) which converts to JSON and inserts it in to the mongo db.