9. Excel hates CSV It clearly means CSV must be doing something right. This is one area where LibreOffice Calc shines in comparison to Excel. Importing CSVs is much more convenient.
Excel won't import ISO 8601 timestamps either, which is crazy these days where it's the universal standard, and there's no excuse to use anything else. You have to replace the "T" separator with a space and also any trailing "Z" UTC suffix (and I think any other timezone/offset as well?) for Excel to be able to parse as a time/date.
A love letter to the CSV format
41–50 of 711 posts
Re: A love letter to the CSV format
#42One thing that has changed the game with how I work with CSVs is ClickHouse. It is trivially easy to run a local database, import CSV files into a table, and run blazing-fast queries on it. If you leave the data there, ClickHouse will gradually optimize the compression. It's pretty magical stuff if you work in data science.
That being said I noticed .parquet as an export format option on Shopify recently and an hopeful more providers offer the choice.
Re: A love letter to the CSV format
#43Excel hates CSV only if you don't use the "From text / csv" function (under the data tab). For whatever reason, it flawlessly manages to import most CSV data using that functionality. It is the only way I can reliably import data to excel with datestamps / formats. Just drag/dropping a CSV file onto a spreadsheet, or "open with excel" sucks.
Now if they would just also allow pasting CSV data as “source” it would be great.
Re: A love letter to the CSV format
#44I greatly prefer TSV over CSV. https://en.wikipedia.org/wiki/Tab-separated_values
The problem with using TSV is different user configuration. For ex. if I use vim then Tab might indeed be a '\t' character but in TextEdit on Mac it might be something different, so editing the file in different programs can yield different formatting. While ',' is a universal char present on all keyboards and formatted in a single way
Re: A love letter to the CSV format
#45I looked at the RFC. What is controversial about it?
Re: A love letter to the CSV format
#46Earlier quoted context omitted.
Agreed, much easier to work with, especially if you can guarantee no embedded tabs or newlines. Otherwise you end up with backslash escaping, but that's still usually easier than quotes.
It's not really easier than CSV if you can guarantee no commas or newlines.
Re: A love letter to the CSV format
#47Earlier quoted context omitted.
That would be solved by using the ASCII control chars Record Separator / Unit Separator! I don't get how this is not widely used as standard.
The _entire_ point of a CSV file is that it's fully human readable and write-able. The characters you mention could be used in a custom delimiter variant of the format, but at that point it's back to a binary machine format.
Except the usages of that character will be rare and so potentially way more scary. At least with quotes and commas, the breakages are everywhere so you confront them sooner rather than later.
Re: A love letter to the CSV format
#48Excel hates CSV only if you don't use the "From text / csv" function (under the data tab). For whatever reason, it flawlessly manages to import most CSV data using that functionality. It is the only way I can reliably import data to excel with datestamps / formats. Just drag/dropping a CSV file onto a spreadsheet, or "open with excel" sucks.
Yea they seem to have added this about a year ago and it works pretty well, to be fair. Now if they would just also allow pasting CSV data as “source” it would be great.
Re: A love letter to the CSV format
#49I greatly prefer TSV over CSV. https://en.wikipedia.org/wiki/Tab-separated_values
The problem with using TSV is different user configuration. For ex. if I use vim then Tab might indeed be a '\t' character but in TextEdit on Mac it might be something different, so editing the file in different programs can yield different formatting. While ',' is a universal char present on all keyboards and formatted in a single way
But then some folks came along about 15 years ago screaming about spaces, and they won, so now tabs are 2 or 4 spaces.
The law of unintended consequences strikes again!
Note: not meant to denigrate you space supporters out there.
Re: A love letter to the CSV format
#50"the controversial ex-post RFC 4180" I looked at the RFC. What is controversial about it?