TIL that RFC 4180 specifies the CSV format to use CRLF line endings (datatracker.ietf.org)
from JackbyDev@programming.dev to programming@programming.dev on 01 Jul 19:24
https://programming.dev/post/33202961

I noticed a repository’s .gitattributes entry for *.csv used text eol=crlf so I investigated and found this.

#programming

threaded - newest

verstra@programming.dev on 02 Jul 08:12 next collapse

I hate that the pleasant news about standardization of CSV come with the let-down that is using two bytes for new lines.

FizzyOrange@programming.dev on 02 Jul 08:42 collapse

Don’t worry, it’s not really standardised despite this attempt. You can use UNIX line endings and nothing bad will happen.

Kissaki@programming.dev on 03 Jul 06:28 collapse

Unless you open it in Excel. In which case bad things will happen no matter what you have in the CSV…

ulterno@programming.dev on 03 Jul 16:01 collapse

If I am using Excel, I am using Windows and I will be changing all text to use CR-LF newline format (if sending from a Linux system) anyway.

Kissaki@programming.dev on 03 Jul 06:34 next collapse

We want to move down to the next line (line feed) but also to the beginning of that line (carriage return) after all.

Laser@feddit.org on 03 Jul 07:39 collapse

I think csv is a bad format, if you can even call it that. Yes, there are some cases where it makes sense. I worked with an oscilloscope at uni which output csv. But other than that, I consider it more of a concept than an interface / exchange standard

ulterno@programming.dev on 03 Jul 15:58 collapse

more of a concept

And it’s better to be considered so.
The name itself suggests a Comma as a separator, but we know how inconvenient that is and that tab characters tend to be useful in most cases.
Even LibreOffice Calc asks the user what they expect as the separator when given a csv file, even if it has enough commas to feel correct.