3 ms·
CSV is inferior to TSV, there's really very little reason to keep using CSV other than taking advantage of its ubiquity.
by ZenoArrow 10y ago
CSV is inferior to TSV, there's really very little reason to keep using CSV other than taking advantage of its ubiquity.
- paulddraper 10y agoCSV allows commas and tabs in fields (actually, all characters, if you choose to). TSV does not allow tabs.
- ZenoArrow 10y agoWhat's more common, tabs in text content or commas in text content? I'd suggest you'll see commas far more frequently, such as in addresses and freetext fields. Can fields with commas be quoted to prevent them from being interpreted as delimiters? Yes they can, but that requires extra vigilance, and in my experience it's frequently overlooked. As for TSV not allowing tabs... the same type of post-processing that goes into allowing for commas to be quoted can go into replacing tabs with multiple spaces.
- paulddraper 10y ago> As for TSV not allowing tabs... the same type of post-processing that goes into allowing for commas to be quoted can go into replacing tabs with multiple spaces. No, replacing tabs with spaces means you cannot distinguish between spaces and tabs. CSV escaping is completely reversible. I agree tabs aren't common, but it sure is nice to have your format allow arbitrary data, rather than just the data a particular person prefers.
- IanCal 10y agoIt's a shame we don't use the ASCII delimiter characters. It would have solved a lot of the quoting issues. https://en.m.wikipedia.org/wiki/C0_and_C1_control_codes#Field_separators https://en.m.wikipedia.org/wiki/C0_and_C1_control_codes#Fiel...
- ZenoArrow 10y agoAgreed, that would be the best delimiter choice for plain text data files.