csv icon indicating copy to clipboard operation
csv copied to clipboard

quote values of type String

Open close2 opened this issue 9 years ago • 4 comments

[ '1', 3 ] should result in '"1",3' Currently 1 is not quoted.

close2 avatar Mar 19 '16 16:03 close2

No, this is not correct. In CSV there is no difference between 1,3 and "1",3. There is no int and string type in CSV like you might be thinking.

Zectbumo avatar May 17 '16 08:05 Zectbumo

Agreed.

I've also received a bug report that numbers are not always quoted, which shouldn't be necessary.

I guess quoting behavior should be an enum: always,onlyStrings,onlyWhenNecessary (something like that) This should be easy to implement, and make everyone happy.

Not sure about the default however.

close2 avatar May 17 '16 08:05 close2

The enum would be nice. As for the default, I recommend quoting only when it is required. This will result in the smallest file size and will be easier to read the raw output.

Zectbumo avatar May 17 '16 09:05 Zectbumo

I also get : "A value of type 'dynamic' can't be assigned to a variable of type 'String'." In : lib/csv_settings_autodetection.dart

flutter-painter avatar Mar 11 '19 15:03 flutter-painter