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
encoding/csv: Provide a mean to change the quote character #8458
Comments
I've submitted a fix: https://go-review.googlesource.com/#/c/1576/ |
Why? Is there a standard that says the quote character can differ? If you have a file format that uses a different quote character, is it really CSV? I don't think so. I'm compelled to close this without action. The encoding/csv package is small and easily forkable elsewhere for PQCSV ("pipe-quoted CSV") or whatever. |
I believe the standard does not specify it. You are right in pointing out that the package is small and easily forkable. Just saw this issue open and thought of fixing it :) |
The standard specifies it as double quote. It's not a tweakable parameter: https://tools.ietf.org/html/rfc4180 says
We'll follow the standard. People needing wacky formats can use wacky packages. |
CSV is well known for being a format ever program implements somewhat differently, like HTML in the early years of the internet. Yes, the standard says that the quote character is |
Can you provide a few examples of such programs, ideally popular ones? Absent a compelling reason, I see no reason to introduce complexity for theoretical uses. Even with examples, I'm tempted to say no just as a minor encouragement to those program's authors and users to do something more normal. |
I know this is old but I would like to add an example data which desperately needs this change to be read. I am currently working with some sentiment analysis stuff which uses SentiWordNet list. A row from the list:
I put each column on a newline so it is easy to distinguish each column. The columns are tab (\t) delimited and long text does not have an enclosure. Obviously, because the long text already has double quotes in it, the csv package gives me an error trying to parse the quotes. Hope what I wrote makes sense lol. |
CL https://golang.org/cl/23401 mentions this issue. |
The intent of this comment is to reduce the number of issues opened against the package to add support for new kinds of CSV formats, such as issues #3150, #8458, #12372, #12755. Change-Id: I452c0b748e4ca9ebde3e6cea188bf7774372148e Reviewed-on: https://go-review.googlesource.com/23401 Reviewed-by: Andrew Gerrand <adg@golang.org>
RFC4180 also mentioned the delimiter has to be comma (","), yet |
@hasnickl This issue is closed. If you want to discuss this, please use the golang-dev mailing list. Thanks. |
by fuzxxl:
The text was updated successfully, but these errors were encountered: