-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/csv: "LazyQuotes" not lazy enough, need an "IgnoreQuotes" mode for highly messy csv input #3150
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
Comments
CL https://golang.org/cl/13659043 references this issue. |
In the meantime, I found this to be helpful: https://code.google.com/p/gocsv/ ... It's tolerant of the quotes. You also don't need to specify the separator and number of fields. I tested with Geonames cities data set which is tab separated. |
I'm for addressing this issue as well, as I've run into it a couple of times now and have put messy workarounds in to address it. One thought is that we could allow setting the quote rune (just like the Comma rune), whereas zero would be no quote rune, i.e. ignored and considered value data. |
CL https://golang.org/cl/23281 mentions this issue. |
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 <[email protected]>
any updates for this? |
Since this issue was filed, we've decided that the standard library's encoding/csv package is going to focus only on RFC 4180, while retaining backward compatibility with what is already there. We aren't going to add new features to handle formats not described in RFC 4180. Instead, we encourage people to make their own copy of the library and modify it for their needs. I'm sorry this doesn't help you, but the reasons for this decision are 1) there are many many many variants of CSV files, and writing one package that can handle all of them will give us a package so complex that it will be hard to use and impossible to test; 2) the code that reads a CSV file is less than 400 lines of Go code anyhow, and it's easy to tweak for whatever odd formats one encounters. I'm going to close this old issue, since we aren't going to be implementing it. |
by philipp.schumann:
The text was updated successfully, but these errors were encountered: