Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DSV #51

Open
ryu1kn opened this issue Jul 4, 2020 · 3 comments
Open

Support DSV #51

ryu1kn opened this issue Jul 4, 2020 · 3 comments

Comments

@ryu1kn
Copy link
Owner

ryu1kn commented Jul 4, 2020

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).
@ryu1kn ryu1kn mentioned this issue Jul 4, 2020
@benj2468
Copy link

benj2468 commented Nov 19, 2020

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.

@willvedd
Copy link

willvedd commented May 14, 2021

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

@jlc
Copy link

jlc commented Feb 24, 2024

I would also like to support this feature, and specifically tab characters (\t). Thank you, nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants