4 ms·
Unfortunately 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 specif
by hermitcrab 3y ago
Unfortunately 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.