For the closest thing to a standard, please refer to
https://datatracker.ietf.org/doc/rfc4180/?include_text=1
2.7 in particular.
7. 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"
Recognising this format as a field type as part of an input range would
not be too difficult, except for 2.6.
6. Fields containing line breaks (CRLF), double quotes, and commas
should be enclosed in double-quotes. For example:
"aaa","b CRLF
bb","ccc" CRLF
zzz,yyy,xxx
Presumably uploading would turn CRLF within quotes into a record break.
This would need to be turned back into a single record. (Think of a
field that contains a postal address.) Scanning an inputRange clearly
cannot modify and join input records.
Thus, the only viable way to process CSV data correctly (i.e.,
compensating for downloading errors) is a new built-in that turns the
field separating commas into something else, specified by the user. The
program could verify that the input does not contain this separator
character.
Of course, doing both is also possible, as long as there are no quoted
CRLFs in inputRange CSV n.
Preferences, anyone?
PS: https://datatracker.ietf.org/doc/rfc7111/?include_text=1
On 08/21/2015 05:07 PM, Mike Walter wrote:
(note the empty field after F3a data) and see what happens.
Ah... a *different*, more detailed input source description. IIRC, missing
fields were not described, just that every field was enclosed in double quotes.
Mike Walter
-----Original Message-----
From: CMSTSO Pipelines Discussion List [mailto:[email protected]] On
Behalf Of James Vincent
Sent: Friday, August 21, 2015 07:07
To: [email protected]
Subject: Re: CSV data specs
Glenn, nice suggestion! It did shave a little off CPU, which I will gladly take!
Mike, good try.
Change the first record to: in.1='"F1a data","F2a data","F3a data",,"F4a
data",",",","F7a data"'
(note the empty field after F3a data) and see what happens.
CSV data is fun to deal with. Even using a hex character for a delimiter can
bite you since the contents of a field could contain that hex character too.
-- *James Vincent*