|
|
|
|
|
by xamuel
805 days ago
|
|
Linebreaks can be escaped in CSV, so splitting a file into rows is actually ~1/3 the complexity of parsing a whole row. See: https://github.com/semitrivial/csv_parser/blob/master/split.... Though I suppose that's the naive approach. You could combine the two into a single file by, like you say, wrapping the row-parser in a (clever, non-trivial) outer loop, and it probably wouldn't take anywhere near 1000 characters to do that... |
|
In some variants of CSV. There isn’t agreement on the format. For example, https://www.ietf.org/rfc/rfc4180.txt says
“While there are various specifications and implementations for the CSV format (for ex. [4], [5], [6] and [7]), there is no formal specification in existence, which allows for a wide variety of interpretations of CSV files.”
That RFC doesn’t even agree with itself, saying
“1. Each record is located on a separate line, delimited by a line break (CRLF).”
but then following that up with:
“6. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes”