CSVs Are Kinda Bad. DSVs Are Kinda Good
41–50 of 133 posts
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#42The article talks about reading and parsing CSV data of unknown variants, but then skips to the solution being using a different format altogether. But you can only switch to a different format if you are producing data, not if you are reading it! And if you are in control of producing data, just produce strict RFC 4180-compliant CSV data and everybody will be able to read it just fine. There is no need to make your…
[flagged]
Exporting data into Excel: provide RFC 4180-compliant CSV data, or just generate minimal XLSX files.
Most Excel users generally don't export to CSV (or practice any data sanity conventions); they seem to believe XLSX is a perfectly fine data exchange format for automated use. (“Oh the import broke? I just added an empty row above the headers, because it looked sloppy.”) Those that do understand that automated data processing means you need to be stricter in what you do in the sheet you are exporting tend to understand how to export proper CSV's from Excel as well.
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#43Many times they just couldn't seem to find the comma. Other times there were commas in the item description (unescaped). My favourite though was when files were edited collaboratively using a Mac, Windows and Linux machines - multiple line-end types FTW! Like I said, a long and somewhat inglorious career..
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#44Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#45Any file format needs a well-specified escape strategy, because every file format is binary and may contain binary data. CSV is kinda bad not only because, in practice, there's no consensus escaping, but also because we don't communicate what the chosen escaping is!
I think a standard meta header like follows would do wonders to improve interchangeability, without having to communicate the serialization format out-of-band.
``` #csv delim=";" encoding=utf8 quote=double locale="pt-BR" header=true ```
(RFC-4180 does specify that charset and header may be specified in the MIME type)
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#46Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#47Good luck with that.
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#48Earlier quoted context omitted.
You can’t put comments in JSON, while that’s fairly easy in CSV. This makes JSON unusable most of the time for human-editable data.
There is no such thing as a comment in CSV.
Comments will happen. If your file format doesn’t allow comments, then people will make up an extension to allow it. This is true even for binary formats.
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#49You still have the issue described by "" with '' if I read the examples correctly.
Re: CSVs Are Kinda Bad. DSVs Are Kinda Good
#50The article talks about reading and parsing CSV data of unknown variants, but then skips to the solution being using a different format altogether. But you can only switch to a different format if you are producing data, not if you are reading it! And if you are in control of producing data, just produce strict RFC 4180-compliant CSV data and everybody will be able to read it just fine. There is no need to make your…
> file = [header CRLF] record *(CRLF record) [CRLF]
I find it kind of wild that you have to have at least one record. Suppose I have a program that lists the events that occurred on a given day. How do I represent the fact that the program ran successfully but that there weren't any events on that day?