rippinrobr / csv-to

A tool that creates and loads databases from CSV files and generates code to interact with the data
MIT License
4 stars 0 forks source link

`ERROR: Parsing ../hockey-databank/AwardsPlayers.csv threw CSV error: record 2254 (line: 2255, byte: 82234): found record with 5 fields, but the previous record has 6 fields` #28

Open rippinrobr opened 5 years ago

rippinrobr commented 5 years ago

Some records End with wha, instead of at the very least wha,,. I will have to see what I can do for hose rows and for characters like ö

Originally posted by @rippinrobr in https://github.com/rippinrobr/csv-to/issues/21#issuecomment-438112934

rippinrobr commented 5 years ago

I've added code to record the error message from the csv parser and then continue parsing the file. Once the code is merged into master I will close this issue

rippinrobr commented 5 years ago

This could be done using something similar to the retrosheet-events parser.

let mut buf_reader = BufReader::new(file);
        let mut rdr = ReaderBuilder::new()
            .has_headers(false)
            .flexible(true) <----- specifically this
            .from_reader(buf_reader);

Now, if I'm to add this should I add a --flexible flag?