Settings

Theme

Why people use CSV instead of DSV?

4 points by james_smith_007 6 years ago · 6 comments · 1 min read


It seems that most of the people use CSV instead of DSV. Why?

At least at the first glance, DSV seems to be a much better format. It is equally powerful, but much more cleaner and reliable.

About DSV and DSV-versus-CSV:

* http://www.catb.org/~esr/writings/taoup/html/ch05s02.html#id2901882

* https://en.wikipedia.org/wiki/Delimiter-separated_values

Consider the following table (column - text):

1 - aaa

2 - bbb bbb

3 - ccc, ccc

4 - ddd "ddd"

In CSV: aaa,bbb bbb,"ccc, ccc","ddd ""ddd"""

In DSV: aaa,bbb bbb,ccc\, ccc,ddd "ddd"

A quote from https://wiki.c2.com/?DelimiterSeparatedValues:

> DelimiterSeparatedValues files and CommaSeparatedValues are equally powerful, but the reading and writing algorithms for CSV have to maintain more state than the ones for DSVs, and so different CSV implementations end up implementing slightly different rules. Therefore using DelimiterSeparatedValues is closer to DoTheSimplestThingThatCouldPossiblyWork.

I don't understand what the author mean. I don't see how _"the reading and writing algorithms for CSV have to maintain more state than the ones for DSVs"_ leads to _"and so different CSV implementations end up implementing slightly different rules"_.

Also, are there any DSV editors on the market?

kevinherron 6 years ago

CSV has reached a critical mass that will not soon be displaced. Decades and decades of legacy software that consumes and produces CSV files and will never be updated.

I didn't even know the "DSV" acronym until I read enough of your post.

longtermd 6 years ago

Because it's not 10X better than CSV. It's merely "slightly" better than CSV, and there's really no pain or need for DSV at all. It has literally zero performance benefits but introduces a ton of compatibility issues.

zelphirkalt 6 years ago

Afaik CSV is only a subset of DSV as indicated by the name: Comma VS Delimiter separated values. A delimiter can be all kinds of things, while comma is just a comma. However, the name is misused in popular tools, which actually do use other delimiters than comma, but still call it CSV. Any DSV reader in theory should be able to read any CSV file, unless the people implementing something and calling it CSV did not think about the meaning of the words.

  • james_smith_007OP 6 years ago

    It's not so. Both CSV (despite of its name) and DSV are able to use an arbitrary character as a delimiter. The real difference between them is the way to escape the delimiter (and to escape the escaper itself). DSV use C-like syntax: \, will be treated as literal comma, \\ will be treated as literal backslash. CSV use quotation marks for this purpose, and in a completely different way.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection