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

CSV allows commas and tabs in fields (actually, all characters, if you choose to). TSV does not allow tabs.


What'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.


> 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.




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

Search: