Navigation Menu

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: LazyQuotes option breaks if the fields are unquoted and the lazy quotes appear at the beginnng of the field #6287

Closed
gopherbot opened this issue Aug 29, 2013 · 10 comments

Comments

@gopherbot
Copy link

by alex@zylman.com:

Similar to issue #6258, but not the same.

What steps will reproduce the problem?
Try to read a CSV file where the fields are unquoted and one of them begins in something
that would need lazy quotes, e.g.
Field1,Field2,"LazyQuotes" Field3,Field4,Field5

What is the expected output?
["Field1", "Field2", "\"LazyQuotes\" Field3",
"Field4", "Field5"]
Length 5

What do you see instead?
["Field1", "Field2", "LazyQuotes\"
Field3,Field4,Field5"]
Length 3

Which compiler are you using (5g, 6g, 8g, gccgo)?
Whatever the default is from https://code.google.com/p/go/downloads/list

Which operating system are you using?
Mac OS X 10.8

Which version are you using?  (run 'go version')
go version go1.1.2 darwin/amd64
@robpike
Copy link
Contributor

robpike commented Aug 29, 2013

Comment 1:

Issue #6286 has been merged into this issue.

@robpike
Copy link
Contributor

robpike commented Aug 29, 2013

Comment 2:

Issue #6285 has been merged into this issue.

@robpike
Copy link
Contributor

robpike commented Aug 29, 2013

Comment 3:

Issue #6284 has been merged into this issue.

@gopherbot
Copy link
Author

Comment 4 by alex@zylman.com:

Ah, sorry about there being a lot of these - I kept getting 502 errors when I was trying
to post them so assumed that it had not posted successfully...

@gopherbot
Copy link
Author

Comment 5 by alex@zylman.com:

I think something like this would be impossible to handle correctly if you didn't have
the context to know that the fields are supposed to be unquoted...

@robpike
Copy link
Contributor

robpike commented Aug 31, 2013

Comment 6:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 7:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 9:

Labels changed: added repo-main.

@dsnet
Copy link
Member

dsnet commented Oct 20, 2017

I believe this is working as intended. A quote at the beginning signifies that this is a quoted string, and the parser continues to follow the appropriate lazy rules for quoted strings.

@dsnet dsnet closed this as completed Oct 20, 2017
@golang golang locked and limited conversation to collaborators Oct 20, 2018
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

4 participants