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

encoding/csv: fails to parse "a"b,c as two fields (with or w/o LazyQuotes) #55069

Closed
sebnyberg opened this issue Sep 14, 2022 · 3 comments
Closed

Comments

@sebnyberg
Copy link

sebnyberg commented Sep 14, 2022

Go version

go1.19 linux/amd64

What did you do?

r := csv.NewReader(strings.NewReader(`"a"b,c`))
r.LazyQuotes = true
fields, _ := r.Read()

What did you expect to see?

Two parsed fields: "a"b and c

What did you see instead?

A single field: a"b,c

@sebnyberg
Copy link
Author

Admittedly, this is a pretty nasty string. It found my way through the IMDB movie dataset ("I am going to Graceland" the movie).

Personally I would prefer it if there was an option to completely disregard quotes. I was hoping LazyQuotes would do just that.

@sebnyberg sebnyberg changed the title encoding/csv: fails to parse "a"b,c (with or w/o LazyQuotes) encoding/csv: fails to parse "a"b,c as two fields (with or w/o LazyQuotes) Sep 14, 2022
@sebnyberg
Copy link
Author

sebnyberg commented Sep 14, 2022

Actually, on second thought, this makes sense from a parsing perspective.

However, it would be great to be able to completely disregard quotes.

@seankhliao
Copy link
Member

Duplicate of #24422

@seankhliao seankhliao marked this as a duplicate of #24422 Sep 14, 2022
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2022
@golang golang locked and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants