News for hackers. Stuff that matters.
Re:So you want to write your own CSV code (2014) by throwaway_pdp09 on Friday May 15, 2020 @07:53AM (#23191092)
> What if a ASCII record seperator shows up

point is, being not human readable and having no keyboard key, you can reasonably expect those special separators not to.

I suppose I'd consider such special-separated files (26 to 29 from memory?) to be machine generated and machine readable only, not intended as human readable without a bit of extra software or eg. a special emacs mode

Re:So you want to write your own CSV code (2014) by roenxi on Friday May 15, 2020 @08:23AM (#23191298)
You're almost certainly describing a file format that already exists and that nobody uses because it is not human-interactable.

Anyone can edit a csv. I often have. An important feature.

The only real stumper in the CSV format is why they didn't use \ as the escape in strings like everyone else. Probably some good reason.

Re:So you want to write your own CSV code (2014) by eyelidlessness on Friday May 15, 2020 @10:32AM (#23192606)
While backslash escaping is very common, double-quote (or double-special-anything) is fairly common as well. I use it all the time in SQL.
Re:So you want to write your own CSV code (2014) by throwaway_pdp09 on Friday May 15, 2020 @09:07AM (#23191707)
Interesting. I don't think I have ever hand edited a CSV (unless you mean created from scratch, well then, perhaps).

OTOH the ability to just look at it... that I've found very valuable and agree there.

Re:So you want to write your own CSV code (2014) by sokoloff on Friday May 15, 2020 @08:07AM (#23191170)
When considering standard A that can only work with machine generated and machine readable files and standard B that can work with all those files plus human-readable/editable files, I don’t find it surprising at all that standard B wins in the market.
Re:So you want to write your own CSV code (2014) by ken on Friday May 15, 2020 @09:42AM (#23192040)
It happens. XPM/PBM/XBM lost to TIFF (and later PNG). Postscript lost to PDF. OpenOffice.org XML couldn't displace Excel's Binary File Format.

As much as I wish that beauty or usability was the primary indicator of market success, the simpler explanation that explains all of these (including CSV) is: Microsoft Office supported them.

Re:So you want to write your own CSV code (2014) by throwaway_pdp09 on Friday May 15, 2020 @09:47AM (#23192090)
I don't know about XPM/PBM/XBM lost but AIUI PDF is just a subset of postscript with compression. If you think MS's binary excel file format is all that secret, I suggest you try unzipping it - it is no more than compressed XML. I have rescued parts of corrupt excel and word files by doing just that.
Re:So you want to write your own CSV code (2014) by mark-r on Friday May 15, 2020 @11:50AM (#23193598)
MS completely redesigned their binary formats a few years ago. You're right about the current format, but the earlier one was completely undecipherable. Even the current XML has quirks in it to be compatible with the older format.
Re:So you want to write your own CSV code (2014) by mike22 on Sunday May 17, 2020 @03:07PM (#23214414)
It was reversible enough to write the Apache POI library. I maintain code that uses the HSSF streaming API portion of the library, which mainly gives you low-level access to the structures in XLS files. The OO.org folks made some very nice documentation: http://www.openoffice.org/sc/excelfileformat.pdf
Re:So you want to write your own CSV code (2014) by ken on Friday May 15, 2020 @03:32PM (#23196382)
PDF diverged from Postscript years ago.

Microsoft’s binary Excel format is not XML -- you’re thinking of its replacement. It was COM/OLE or some such.

Re:So you want to write your own CSV code (2014) by greggman3 on Friday May 15, 2020 @11:46AM (#23193526)
Binary formats win I think when the ASCII format is significantly greater in storage size and parsing speed. XPM/PBM/XBM are enormous compared to any binary image format. And remember these images used to get put on 1.4meg floppies and sent over 2400baud modems.

It's basically use the right tool for the job. For pixels that's a binary format. For mostly text, text itself works pretty well.

Re:So you want to write your own CSV code (2014) by throwaway_pdp09 on Friday May 15, 2020 @08:20AM (#23191270)
There is no standard but one for CSV files (the RFC 4180 mentioned).

The whole article pretty well rams home the fact there is no standard B because there is no standard which is adhered to.

Re:So you want to write your own CSV code (2014) by sokoloff on Friday May 15, 2020 @08:23AM (#23191300)
Humans are not bound by the computer science definition of “standard”.

But you’re correct that I was using the word “standard” imprecisely to mean something more like “file extension” rather than an IETF RFC.

Re:So you want to write your own CSV code (2014) by ISL on Friday May 15, 2020 @09:42AM (#23192049)
If someone copy-pastes a line from one CSV to a string within a field of another, the second will have record separators from the first within a single field.