Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And this is why CSV is one of the most broken file formats of all time.

"Comma-separated values" for spreadsheets doesn't work when comma is the decimal separator. Localized versions of Excel decided to store numbers in the local format, and just used some other delimiter for their version of "CSV" (NCSV?). So what happens is that you open an American .csv file in a local Excel, and you get an unexplained mess. The same happens going the other way.



This isn’t a problem if you surround your field data with quote marks (this is also required if the field data contains newlines).

https://en.wikipedia.org/wiki/Comma-separated_values#Basic_r...


You can select the separator when opening the file in LibreOffice Calc (don't have Excel on this machine but I know it's possible as well). Setting it to ";" fixes this for all European data sets I have worked with that use "," where "." would be used in the U.S. You can also specify the separator in pretty much every other tool that imports CSV (for example in R).


Pipe | is even better.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: