3 ms·
CSV is the javascript of the tabular data world. Everyone thinks they can do better, but nothing's more widely supported (for a sufficiently generous definitio
by michaelt 3y ago
CSV is the javascript of the tabular data world.
Everyone thinks they can do better, but nothing's more widely supported (for a sufficiently generous definition of 'supported')
- hermitcrab 3y agoUnfortunately CSVs vary a lot in the wild. Some people use commas as a delimiter, some use semi-colons. Escaping rules vary. And the text encoding is not specified. I randomly generated some CSVs and fed them into Excel and Numbers and they were differently interpreted.
- mst 3y agoThis is why I tend to use the Pg COPY version of TSV - works beautifully with 'cut' and friends, loads trivially into most databases, and the 'vary a lot' problem is (ish) avoided by specifying COPY escaping which is clearly documented and something people often already recognise. Generally my only interaction with CSV itself is to fling it through https://p3rl.org/Text::CSV https://p3rl.org/Text::CSV since that seems to be able to get a pretty decent parse of every sort of CSV I've yet had to deal with in the wild.
- Tijdreiziger 3y agoCountries that use . as the thousands separator (e.g. 1.000) use , as the CSV separator. Countries that use , as the thousands separator (e.g. 1,000) use ; as the CSV separator. Why? Because that’s how Excel does it.
- Tijdreiziger 3y agoErrata: as the decimal separator, not as the thousands separator.
- dimask 3y agoFunny thing, excel, which is the most common spreadsheet editor, does not practically support CSV files if you happen to live in countries where the default official convention is using commas for decimal points in numbers. Unless you go around and manually set stuff in how it imports it or you change your default settings. It has reached meme levels at my work. Tab separated files are much better imo in not getting confused with the delimiter for a sufficiently sane tsv file.
- Tijdreiziger 3y agoYes it does, but then it uses ; as a separator.