News for hackers. Stuff that matters.
Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @12:50PM (#28223868)
> The entire article is about replacing CSVs for exchanging data exported from Excel...

No, it's not. It's about replacing CSVs for exchanging data. It mentions that CSVs often are the product of someone exporting data from a spreadsheet or doing a table dump, and how just doing that tends to create a ton of problems, but Excel is an example, not the subject matter of the article.

> The business world will laugh at you and continue on their merry CSV way.

The business world pays me a lot of money to teach them not to use CSVs.

Re:Time to retire the CSV? by masklinn on Wednesday August 18, 2021 @01:20PM (#28224366)
> The business world pays me a lot of money to teach them not to use CSVs.

Could you teach them better and faster? I don't think they're getting it. You have my blessing to use violence.

Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @01:42PM (#28224636)
> Could you teach them better and faster? I don't think they're getting it. You have my blessing to use violence.

I'm trying man. I'm trying.

Re:Time to retire the CSV? by barbarbar on Wednesday August 18, 2021 @11:26PM (#28230024)
This is the right suggestion.
Re:Time to retire the CSV? by wombatpm on Wednesday August 18, 2021 @02:06PM (#28224933)
Of course there is a old solution in the ANSI character set. File, Record, Group and Unit separator characters
Re:Time to retire the CSV? by hermitcrab on Wednesday August 18, 2021 @04:09PM (#28226429)
Yes. You could get a long way with a text format in which:

-the first line is always a header

-fields are separated by Unit separator characters

-records are separated by Record separator characters

-encoding is UTF8

If you wanted to get fancy you could also have:

-comment lines

-column metadata (e.g. column 0 is an ISO date, column 2 is text, column 3 is an integer)

Both the above could start with a Unicode character unlikely to be used for anything else.

I think that would avoid 99% of the pain of CSV files. The downside is that the use of things like the Unit separator mean that it wouldn't be easy to create/edit manually.

I don't suppose it will ever happen though.

Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @05:52PM (#28227640)
> it wouldn't be easy to create/edit manually

I mean, you'd have to be using a pretty terrible tool for it not being able to handle that, and I suspect if such an approach were to become prevalent, that tool would either fix the glitch or become largely unused.

Re:Time to retire the CSV? by hermitcrab on Wednesday August 18, 2021 @06:00PM (#28227704)
Are there any editors that let you insert a Unit separator character as easily as a comma?
Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @06:05PM (#28227744)
All of the programmable ones? ;-)
Re:Time to retire the CSV? by hermitcrab on Wednesday August 18, 2021 @06:15PM (#28227831)
So that's a no then. ;0P
Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @10:12PM (#28229583)
? Quite the contrary. It's more, "all the ones that any craftsman should be using".
Re:Time to retire the CSV? by lanstin on Thursday August 19, 2021 @12:34AM (#28230351)
A lot of excels and csvs are made by people other than programming crafters.
Re:Time to retire the CSV? by scbrg on Thursday August 19, 2021 @04:33AM (#28231632)
As with pretty much everything else computing, the world suffers because Microsoft has been dumping terrible tools on it for decades, and people just take their garbage as the way things have to be.
Re:Time to retire the CSV? by cbsmith on Thursday August 19, 2021 @07:09AM (#28232430)
Excel has its advantages, but it is funny the tools people choose to work with. The number of times Access would make more sense...
Re:Time to retire the CSV? by atatatat on Thursday August 19, 2021 @10:28AM (#28234251)
Didn't they sunset Access in lieu of Power BI Apps or whatever the hell they're calling their shot at no code these days?
Re:Time to retire the CSV? by cbsmith on Thursday August 19, 2021 @12:44PM (#28236089)
Re:Time to retire the CSV? by cbsmith on Thursday August 19, 2021 @07:08AM (#28232422)
Yes indeed. It often means they do extra work because they're using the wrong tools.

But you gotta admit that excel is a pretty terrible tool to hand edit a CSV with... ;-)

Re:Time to retire the CSV? by barbarbar on Wednesday August 18, 2021 @11:19PM (#28229973)
But it sounds like a very very good approach.
Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @03:14PM (#28225850)
Yup. I mean, if you're going to go with a text encoding, you might want to, you know, use the features of the text encoding that were put there explicitly for said purpose...

...or you could invent abominations like CSV, TSV, etc. ;-)

Re:Time to retire the CSV? by wombatpm on Wednesday August 18, 2021 @02:03PM (#28224901)
TSV solve a lot of the pain
Re:Time to retire the CSV? by hermitcrab on Wednesday August 18, 2021 @04:10PM (#28226441)
As long as you don't need to store tabs or carriage returns in your data. ;0)
Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @03:13PM (#28225838)
...or, you know, you could use the ASCII characters specifically defined for separating records and units. ;-)
Re:Time to retire the CSV? by derefr on Wednesday August 18, 2021 @04:07PM (#28226409)
If only I could type them on my keyboard. (I think this is a big part of why CSV is the way it is — people want to be able to hand-edit it, or at least hand-produce small test datasets to test the systems on the other end.)
Re:Time to retire the CSV? by cbsmith on Wednesday August 18, 2021 @04:16PM (#28226508)
The funny thing is you can type any character on a keyboard. It's the same weird disconnect about "text file formats are human-readable". Either way you need a tool that can render & read the format in question. It does't much matter what format you actually store the data in, because you don't read & write the bites directly.