3 ms·
But now all our strings might be numbers! We now have to parse every quoted string, and we can no longer represent numbers as text. unquoted input: 0,
by itishappy 3y ago
But now all our strings might be numbers! We now have to parse every quoted string, and we can no longer represent numbers as text.
unquoted input:
0, 10, "Text", "123"
unambiguous output:
(Num) 0, (Num) 10, (Text) Text, (Text) 123
quoted input:
"0", "10", "Text", "123"
output :
(Num) 0, (Num) 10, (Text) Text, (Num) 123
- elric 3y agoWhy would you quote Text in the first example? That makes no sense. Text does not contain any delimiters or special characters. Unquoted input should look like this: unquoted input: 0,10,Text,123 Note the absence of spaces as well. Not sure what flavour of CSV you are using, but there usually aren't spaces after the delimiter.
- itishappy 3y agoFair point, but that doesn't really resolve the issue. Here's a cleaned up example showing the same problem: unquoted input: 0,10,"Text,","123" output: (Num) 0 (Num) 10 (Text) Text, (Text) 123 quoted input: "0","10","Text,","123" output: (Num) 0 (Num) 10 (Text) Text, (Num) 123