Re:Time to retire the CSV?
by godshatter on Wednesday August 18, 2021 @04:46PM
(#28226885)
That's true. You could scan the file and see if there are any other types of double quote escaping happening, but if there isn't any that wouldn't help either. It's also negated by the multiple formats in the same file point.
So, yeah. Can't really be done without making too many assumptions that will break later.
cat input1.csv input2.csv > output.csv
resulting in a single file containing multiple formats.
Also, what variant is this:
What is the value of the third column?Is this a CSV file without quoting? Then it's
Or is it a CSV file with double quote escaping? Then it's This is fundamentally undecidable without knowledge of what the format it is.You can decide to just assume RFC compliant CSVs in the event of ambiguity, but then you absolutely will get bugs from users with non-RFC compliant CSV files.