Delimiter Separated Values

A more general name for TabDelimitedTables. As distinguished from CommaSeparatedValues, which is also a misnomer (CSV files can use things other than ',' for the field separator.)

The difference between DelimiterSeparatedValues and CommaSeparatedValues is not really in the choice of special characters. Both formats feature three special characters:

For both formats you can find examples of files using different characters for the separators. For example, MicrosoftExcel emits CommaSeparatedValues files using ',' as the field separator in the US locale, but uses ";" for the field separator in Germany, due to decimal commas (see AmericanComputingAssumption). On the other side, many databases emit DelimiterSeparatedValues files using tab as the field separator, but /etc/passwd is an example of a DelimiterSeparatedValues file that uses ":" as the field delimiter.

The difference between a DelimiterSeparatedValues and a CommaSeparatedValues file is the quoting behavior. Any time you want to put a special character in a field of a DelimiterSeparatedValues file, you place the escape character before it, and you're done.

In a CommaSeparatedValues file, if the field value contains special characters, you wrap the entire field in quotes, and double any quote characters that remain inside the field value. And possibly ignore whitespace outside the quotes. And it's an error to start or end a quote anywhere other than the beginning or end of a field. And some programs interpret a newline following double-quote as escaping the newline to continue a value across lines, but others don't.

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.

Many tools already support CSV, but not necessarily arbitrary DSV. Thus, ItDepends.


EditText of this page (last edited October 10, 2012) or FindPage with title or text search