NotWoods / gtfs-to-pouch

Converts a GTFS file to PouchDB dumpfiles
MIT License
2 stars 2 forks source link

Number of columns does not match header #12

Open Decat-SimonA opened 5 years ago

Decat-SimonA commented 5 years ago

When running this script against https://developers.google.com/transit/gtfs/examples/sample-feed.zip, it throws this error:

$ npx gtfs-to-pouch -i ~/Downloads/sample-feed.zip -o pouch-dbs
agency: Starting dump
stops: Starting dump
routes: Starting dump
trips: Starting dump
stop_times: Starting dump
calendar: Starting dump
calendar_dates: Starting dump
fare_attributes: Starting dump
fare_rules: Starting dump
shapes: Starting dump
frequencies: Starting dump
Number of columns on line 17 does not match header

The stop_times.txt contains:

trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_time,shape_dist_traveled
AB2,12:05:00,12:05:00,BULLFROG,1,,,,
AB2,12:15:00,12:15:00,BEATTY_AIRPORT,2

I have not tested this yet, but it might be fixed by adding relax_column_count: true in the csvParser option in https://github.com/NotWoods/csv-to-pouch/blob/master/src/parseCSVFile.js

NotWoods commented 5 years ago

I think you're right. I'll add that option in soon, thanks for finding it 😄