News for hackers. Stuff that matters.
Re:Time to retire the CSV? by AtlasBarfed on Wednesday August 18, 2021 @12:37PM (#28223679)
There are mature CSV libraries for most major languages that handle 99% of the problems of CSV.

CSV should be better standardized, but ... whatever, what should be done to "fix" CSV is to advertise the proper use of the libraries and the nontrivial aspects of a superficially trivial format.

A format that is trivially useful in 99% of cases is far better than many other "worse is better" things in computing.

Re:Time to retire the CSV? by masklinn on Wednesday August 18, 2021 @01:26PM (#28224448)
> There are mature CSV libraries for most major languages that handle 99% of the problems of CSV.

They really don't. In fact I'd go further and confidently state that they really can't, because tons of mis-parsed CSVs are heuristic judgement values, and those tools don't really have the ability to make those calls.

I've never seen a "mature CSV library for most major language" which'd guess encoding, separators, quoting/escaping, jaggedness, … to say nothing of being able to fix issues like mojibake.

Re:Time to retire the CSV? by burntsushi on Wednesday August 18, 2021 @06:20PM (#28227875)
No, they really do. But 99% isn't 100%. Compare Python's csv parser with Go's. The former will prefer a parse for any input, and this is done in a fairly consistent way that at least gives one the opportunity to deal with "malformed" csv. The latter is a strict parser and coughs up an error upon almost any deviation from RFC 4180. I couldn't use the latter in practice because of it. It would just choke on too many csv files I had.
Re:Time to retire the CSV? by masklinn on Thursday August 19, 2021 @02:00AM (#28230831)
> No, they really do. But 99% isn't 100%.

Neither is 0. Python’s csv library does not handle any problem, it applies the separators / quoting / escapes it was given and that’s that. It gives the developer the opportunity to handle things, but if the developer isn’t aware nothing is handled.

Re:Time to retire the CSV? by burntsushi on Thursday August 19, 2021 @12:56PM (#28236264)
If you're just going to quote me out of context and not bother responding to the actual substance of my comment (which was a high level but concrete comparison of two different CSV parsers, demonstrating an important qualitative difference with respect to csv parsers solving problems), then please, don't bother responding.
Re:Time to retire the CSV? by adgjlsfhk1 on Wednesday August 18, 2021 @01:09PM (#28224215)
The problem is that even the fastest CSV readers are 10-100x slower than readers of better defined binary formats (like Arrow)