Open houshuang opened 8 years ago
Thats the Golang CSV reader which has a weird escaping rule compared to the rest of the world. https://golang.org/pkg/encoding/csv
"the ""word"" is true","a ""quoted-field""
results in
{`the "word" is true`, `a "quoted-field"`}
I will do more research whether it can be configured for the Go CSV reader to support custom escape characters.
I wouldn't call Golang's CSV reader weird, that's just the weird CSV format. RFC 4180 says
If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example: "aaa","b""bb","ccc"
I wouldn't call Golang's CSV reader weird, that's just the weird CSV format. RFC 4180 says
Okay that makes sense. But would be cool if it was configurable (perhaps it is and I just didn't found out).
I don't know if this is part of the official CSV specification (if there is one), but it would be useful to handle escaped quotation marks. For example, pgfutter chokes on this line:
however, when I remove all \" with sed, it imports beautifully.