You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:
Run "go version" and compare against
http://golang.org/doc/devel/release.html If a newer version of Go exists,
install it and retry what you did to reproduce the problem.
Thanks.
What does 'go version' print?
go version go1.2.1 darwin/amd64
(the bug is probably in other versions, given that src/pkg/encoding/csv/reader.go
explicity does not
handle and single \r (lines 180-193)
What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.
http://play.golang.org/p/dr_cz65h_u
(changing the delimiter to \n fixes the problem
1. Read a CSV file with \r as the record delimiter
What happened?
http://play.golang.org/p/dr_cz65h_u
Record 0, []string{"One", "Two", "Three\rFour",
"Five", "Six\rSeven", "Eight", "Nine"}
What should have happened instead?
Record 0, []string{"One", "Two", "Three"}
Record 1, []string{"Four", "Five", "Six"}
Record 2, []string{"Seven", "Eight", "Nine"}
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
The package is acting as documented and it's not clear to me that we can change this
now. You can work around the problem by inserting a reader to add \n after each \r. If
you want to pursue this, please raise it on the mailing list. Thanks.
aarrggrggrgrgrg! I'm sure I'm just screaming into the wind here, but the obvious solution would be to add a field to the reader to denote the type of line ending expected, or even add an option to deal with either. .csvs of both types have existed for 10s of years. There are many, many ways to deal with this without breaking backward compatibility
The text was updated successfully, but these errors were encountered: