4 ms·
You cannot require CSV as a standard format because CSV itself has no standard. There are multiple variants of CSV and there's no way for a CSV file to declare
by zarzavat 4y ago
You cannot require CSV as a standard format because CSV itself has no standard. There are multiple variants of CSV and there's no way for a CSV file to declare which variant it's using in a standard way, which means you have to manually check that every single file parsed correctly, because if you accidentally parse a CSV file as the wrong variant there is no way for the parser to know and it will just silently corrupt your data.
Sometimes CSV files themselves are ambiguous because they don't use any quoting so you end up with some lines that have more columns than others, and require manual repair line-by-line by a human.
Don't use CSV, it's a dreadful format.
- hwillis 4y ago> Sometimes CSV files themselves are ambiguous because they don't use any quoting so you end up with some lines that have more columns than others, and require manual repair line-by-line by a human. It's wild that we haven't just started using unicode and line/group separator characters for tabular data instead of csv/tsv. Whoever decided to use a common semantic character as syntax is an evil, devious bastard. That said, there is one thing I like about CSV and similar formats: they are inherently tabular. You don't have to worry about someone adding sub-objects to your JSON (or replacing a primitive field with an object/array). Extra columns are brainless to add or process, but converting sub-data to a line is not.