News for hackers. Stuff that matters.
Re:Why isn’t there a decent file format for tabular data? by wodenokoto on Wednesday May 04, 2022 @01:06AM (#31256950)
But that’s sort of the problem with csv.

You never really know which rules your csv files has. Many .csv files are indeed tab separated.

Re:Why isn’t there a decent file format for tabular data? by lordnacho on Wednesday May 04, 2022 @02:14AM (#31257272)
Gotta wonder why the format isn't just a column separator char, a row separator char, and then all the data guaranteed not to have those two chars. Then you could save the thing by finding any two chars that aren't used in the data.

I guess this is why we have a zillion formats.

Re:Why isn’t there a decent file format for tabular data? by Brometheus on Wednesday May 04, 2022 @03:27AM (#31257712)
ASCII Code 29: Group Separator

ASCII Code 30: Record Separator

ASCII Code 31: Unit Separator

https://theasciicode.com.ar/ascii-control-characters/record-...

Re:Why isn’t there a decent file format for tabular data? by kbouck on Wednesday May 04, 2022 @05:23AM (#31258316)
this doesn't directly address the ease-of-editing concern, but if you have csv (or tsv) and want ascii (0x1f, 0x1e) or unicode(U+241F, U+241E) separated (or vice versa), 'miller' [0] is a command line tool that supports converting among these formats with these one-liners:

    mlr --icsv --oasv cat input.csv  # csv to asv
    mlr --iasv --ocsv cat input.asv  # asv to csv
[0] https://miller.readthedocs.io/en/latest/

[1] https://miller.readthedocs.io/en/latest/file-formats/#csvtsv...

Re:Why isn’t there a decent file format for tabular data? by jph on Wednesday May 04, 2022 @03:16PM (#31264656)
You're right, Miller is great for this, and it turns out that Miller already offers Unicode Separated Values (USV).
Re:Why isn’t there a decent file format for tabular data? by srik on Wednesday May 04, 2022 @04:19AM (#31257992)
Thank you for pointing them out. I've browsed, and searched through that ascii table countless times, usually looking for something in particular, yet never realized that there were such a thing as separators before.
Re:Why isn’t there a decent file format for tabular data? by cestith on Wednesday May 04, 2022 @02:47PM (#31264321)
It makes more sense to me in these days of ubiquitous encoding of in-band data that it would be easier to edit if we just used tabs and newlines. If you need a tab in your data, the standard could support either \t (requiring \\t if you need a literal backslash followed by a literal 't') or %09 or &09; or \x09 or something.
Re:Why isn’t there a decent file format for tabular data? by account42 on Thursday May 05, 2022 @11:04AM (#31274286)
If you require escaping then you may as well stick with csv - better to have the character that needs to be escaped to be common enough that people will run into it during testing.
Re:Why isn’t there a decent file format for tabular data? by cestith on Thursday May 05, 2022 @12:38PM (#31275547)
My actual preference is LTSV. Then all that needs escaping or encoding is a quote since a tab or newline inside the quotes is different from one outside the quotes. And I prefer encoding to escaping generally, since it's easier for someone else to come along and build a fairly naive parser.
Re:Why isn’t there a decent file format for tabular data? by chimprich on Wednesday May 04, 2022 @04:53AM (#31258161)
> Gotta wonder why the format isn't just a column separator char, a row separator char

That's what the article proposes.

Re:Why isn’t there a decent file format for tabular data? by m_eiman on Wednesday May 04, 2022 @02:42AM (#31257442)
Then you can't edit or view it in a normal text editor, which is part of the appeal of CSV.
Re:Why isn’t there a decent file format for tabular data? by ant6n on Wednesday May 04, 2022 @04:56AM (#31258172)
Maybe normal text editors should support the separators.
Re:Why isn’t there a decent file format for tabular data? by alpaca128 on Wednesday May 04, 2022 @05:40AM (#31258386)
That and the fact that the comma (or semicolon, as I prefer it due to the rare usage) is on every keyboard.

A text editor can be made to handle those separators, but editing or processing the file can be more cumbersome than csv and tsv.

Re:Why isn’t there a decent file format for tabular data? by atoav on Wednesday May 04, 2022 @03:10AM (#31257623)
I guess if you use an strange character nobody has on their keyboard, you could also just make it a binary format for efficiency
Re:Why isn’t there a decent file format for tabular data? by Brometheus on Wednesday May 04, 2022 @03:27AM (#31257716)
See my sibling comment.
Re:Why isn’t there a decent file format for tabular data? by thatjoeoverthr on Wednesday May 04, 2022 @03:25AM (#31257702)
It’s a very meta-level problem. The main problem with CSV is “this is CSV” is an ambiguous statement. One could commit to a rule set, and give it a new name. Probably, someone has done this already.
Re:Why isn’t there a decent file format for tabular data? by gregw2 on Wednesday May 04, 2022 @05:00AM (#31258192)
This is why you say RFC 4810 CSV
Re:Why isn’t there a decent file format for tabular data? by _Algernon_ on Wednesday May 04, 2022 @03:38AM (#31257775)
Sounds like xkcd 927