rust-transit / gtfs-structure

Read a GTFS file
MIT License
61 stars 32 forks source link

Add trim fields option to csv reader #76

Closed stefanw closed 3 years ago

stefanw commented 3 years ago

Some GTFS feeds are not particularly clean. I found that adding the option to the CSV reader to trim whitespace in field values allows parsing some of these unclean CSVs.

This allows reading numerical values like " 3" (note the space). Example of a broken feed is New York's MTA Bus Service in the Bronx.

This will change string values with leading/trailing whitespace, but I think it's OK as these are not really meaningful.