5 ms·
You didn't mention handling new lines as data. Excel for example will include these as-is and double quote the cell. It is very easy to overlook edge cases in
by hnick 5y ago
You didn't mention handling new lines as data. Excel for example will include these as-is and double quote the cell.
It is very easy to overlook edge cases in CSV.
- rendall 5y ago> It is very easy to overlook edge cases in CSV. That was not a criticism from the original article, and isn't even true. If you have newlines in your original data, and you "overlooked" this "edge case", then neither JSON nor YAML nor any other format will save you. The same fix applies to them all. This is really a very poor criticism.
- hnick 5y agoThe only reason I replied was that you said: > The algorithm for creating well-formed CSV from data is straightforward and almost trivial: if the datum has no comma in it, leave it alone. It's good to go. > Not complicated and covers every edge case Maybe more context was implied, but I didn't want anyone to think it's that simple. I have received and had to process CSV data with unexpected new lines. It gets nearly everyone the first time when they try to process a CSV file line by line.
- rendall 5y agoThat is a fair point :)