csv-writer
csv-writer copied to clipboard
Support DSV
Allowing this library to accept field delimiters other than comma (,) and semi-colon (;) is sometimes requested, and I'm thinking to support this by introducing a new writer class called DsvWriter.
The problem is that I haven't been able to find an authoritative specification for DSV (Delimiter-Separated Values), whereas we have RFC4180 for CSV (Comma-separated values).
This feature would be aligned with something described in this Wikipedia page; so:
- Field delimiter is an arbitrary non-control character (
,/|/~// ...) except double-quote ("), plus tab character. - Field escape character is double-quote.
- Double-quote character in a field is escaped with another double-quotes (i.e. double-quote in a field will become double double-quotes in the output DSV).
I would like to second this feature request. I particularly would be interested in |, but others would be appreciated as well. I took a look at RFC180 as well, and see no reference to ; anyhow.
I'd like to show my support for this feature. I'm sure there might be some complexities under the hood to support arbitrary characters, but it sure seems like an oddly arbitrary choice to limit to commas and semicolons. This library does such an amazing job at creating comma-delimited files but is a non-starter for my team because of partner requirements.
Reading the thread in #8 is interesting and you bring up an interesting point that this library is titled csv-writer. Which is true, but I've found that in practice, a lot of partners I've worked with, both technically savvy or not, use the term "csv" not literally but to speak about a character delimited file. Perhaps as an industry we should swap the ancroynm's c from "comma" to "character".
I would also like to support this feature, and specifically tab characters (\t). Thank you, nice work.