cassava icon indicating copy to clipboard operation
cassava copied to clipboard

Allow unescaped characters or strings (e.g. double quotes) in ToField

Open spl opened this issue 10 years ago • 3 comments

I would like to make a CSV containing a field with hexadecimal digits. This field should always be treated as text by Microsoft Excel, but Excel converts number-like text into numbers by default (e.g 55e2 is converted to 5500). There is a workaround using double quotes ", but double quotes are escaped by Data.Csv.encode.

Is there any way to prevent or control escaping during encoding?

I think this feature request is much like the one for #68.

spl avatar Jan 26 '15 12:01 spl

Would a global DecodeOptions option do (i.e. never quote any fields) or do you need per-field control?

tibbe avatar Feb 06 '15 22:02 tibbe

I would prefer to have more fine-grained control over my output. (Considering how broad the formats and uses of “CSV” are, I can imagine others would find that useful, too.) So, I would prefer a per-field option, e.g. do not do escaping.

spl avatar Feb 08 '15 16:02 spl

Is there something like this after 5 years passed? Even global mode would be useful, e.g. for loading a list of users with password from a file with lines like this:

user,password
qwerty,%6y2"7""a;'_1)9

kirillt avatar Oct 09 '20 11:10 kirillt