Fatal error while reading in messy data using DataFrames, CSV

Yeah, the only fatal error for CSV.jl is when you have an invalid quoted cell like that; so if it starts parsing a cell and encounters an “open quote character”, then it needs to find a matching “close quote character” and if not, then it hard bails. So you perhaps have a cell somewhere that starts with a '"' character, purely by coincidence, and because CSV.jl defaults quotechar='"', then it thinks the cell will be quoted, but then doesn’t find a closing quote and panics. So one potential solution, if you know you don’t have any quoted fields in your file is to do quotechar='\0' or something, i.e. set quotechar to something that it won’t find at all in the file.

1 Like