News for hackers. Stuff that matters.
Re:Time to retire the CSV? by nolok on Wednesday August 18, 2021 @11:14AM (#28222234)
Xlsx (office format for almost a decade now) are zip and XML all the way. Not fun to look at, but totally readable by a human.
Re:Time to retire the CSV? by daxuak on Wednesday August 18, 2021 @11:20AM (#28222380)
Human can't efficiently write or parse XML or json, though. In some scenarios CSV hits the right spot to be accessible to human and computer, and the table can be laid out so that one can sort/grep/awk to quickly gain some insight.
Re:Time to retire the CSV? by cogman10 on Wednesday August 18, 2021 @11:26AM (#28222507)
As someone that works with maven and npm.... what?

This is valid JSON

    [["bob", "jones", 1, 22],
    ["frank", "was", 32, 45]]
That's unreadable and unparsable by a human?

Not only is JSON often more parsable, because it's structured it also becomes a lot easier to query.

I grep and awk xml and json stuff all the time. I also have the added bonus of being able to use `jq` for json content.

Re:Time to retire the CSV? by daxuak on Thursday August 19, 2021 @01:15PM (#28236538)
Late for the response but: JSON naturally encourages data to structural in ways that are often nested. In your example, if there's one or two additional layers of context (say, affiliation of the two persons), maintaining a CSV-like layout will be more cumbersome and unnecessary. I don't see many CSV or tabular-like JSON/XML in the wild and they really shouldn't be used that way.
Re:Time to retire the CSV? by shapefrog on Wednesday August 18, 2021 @12:00PM (#28223130)
Thats just a CSV with extra steps.
Re:Time to retire the CSV? by cogman10 on Wednesday August 18, 2021 @12:10PM (#28223300)
Nope, that's CSV without the drawbacks of CSV. That's CSV that can have special characters and doesn't suffer from delimiter problems.

When someone says "Maybe we can fix CSV" this is what you should do instead of trying to "fix" CSV.

Re:Time to retire the CSV? by mongol on Wednesday August 18, 2021 @01:18PM (#28224343)
Interesting. This is JSON++ somehow. What should it be called? Line-oriented JSON? Row-JSON?
Re:Time to retire the CSV? by cogman10 on Wednesday August 18, 2021 @01:27PM (#28224460)
It's just JSON. It's not an extension to the spec, it's a subset of the spec. If anything, you could say it's JSON--.
Re:Time to retire the CSV? by mongol on Wednesday August 18, 2021 @01:41PM (#28224620)
Well, to work as a CSV-like JSON, i.e greppable similar to a CSV it needs formatting with linebreaks as above. It is still completely valid JSON. ++ is the formatting convention.
Re:Time to retire the CSV? by cogman10 on Wednesday August 18, 2021 @01:54PM (#28224763)
Gotcha.

Yeah, it's never really come up as it's generally trivial to convert into this format from either a text editor or sed (Look for the `],[` and put a new line after the comma).

Re:Time to retire the CSV? by dullgiulio on Wednesday August 18, 2021 @11:19AM (#28222356)
Readable but not comprehensible. CSV is hard to beat in that sense, being somewhat "natural" like a table written on paper.
Re:Time to retire the CSV? by throwawayswede on Wednesday August 18, 2021 @12:30PM (#28223582)
Also it's way more difficult to parse than CSV. I'm not saying that CSV is better (or worse), just that to each it's job! Wtf is this about retiring a format because it doesn't fit someone's expectation!