4 ms·
Non standard delimiters. Escaping delimiters in fields - sometimes with a \, sometimes doubled (""), sometimes not at all. Double new lines. Poor handling from
by turtlebits 5y ago
Non standard delimiters. Escaping delimiters in fields - sometimes with a \, sometimes doubled (""), sometimes not at all. Double new lines.
Poor handling from standard CSV libraries. Either unable to read or unable to create for some downstream process.
- rendall 5y agoThat sounds like the problem of badly formatted CSV, not a problem with CSV per se. If you stick to one delimiter, and that delimiter is a comma, and escape the delimiter in the data with double-quotes around the entry, and escape double quotes with two double-quotes, well, you have written CSV that is correct and looks correct and will be parsed correctly by literally every CSV parser.
- adzm 5y agoPretty much the rfc. https://datatracker.ietf.org/doc/html/rfc4180 https://datatracker.ietf.org/doc/html/rfc4180 Parsers are trickier if you want to be lenient, but exporters are dead simple.
- masklinn 5y ago> That sounds like the problem of badly formatted CSV That’s what CSV is. That’s what happens when you ingest CSVs whose production you don’t control. > If you [ignore everything people literally clamour for in these comments and praise csv for] Yes i also like ponies.
- rendall 5y ago> "That’s what CSV is." That's really not a serious argument against CSV. Since you paraphrase in a silly way, I can do it too! Your "argument" is "Badly formatted files exist, therefore CSV bad". Everyone "against CSV" seems to be arguing against badly formatted CSV, and leaping to the conclusion that "CSV is just bad" without much more to say about it. I'm sorry that badly formatted CSV gave you a bad time, but the format is fine and gets its job done. "It doesn't have x, y or z feature therefore no one should be using it ever" is kind of a dumb argument, honestly.
- Dylan16807 5y ago> Your "argument" is "Badly formatted files exist, therefore CSV bad". The argument is actually that the badly formatted CSV files have taken over, therefore CSV is bad. You can't reject them, so your import becomes unreliable.