|
Is there any "official" or "reasonably standardized format" for CSV (_C_omma
_S_eparated _V_alue) data?
I guess it's pretty obvious, mostly, but how are the delimiter characters
typically encoded (specifically: comma, double-quote, and newline)?
In double-quotish strings (i.e., "foo foo foo"), how do you write a double-
quote (") within that string? Do you escape it with \ and write \" or do you
double it up and write ""? Can you write commas (,) inside double-quotish
strings or do those have to be escaped too?
What's a string? Anything matching /[^0-9]/ or not matching /^[0-9]+$/ ?
(uh, plus any gunk for handling decimals and e+12 and all that funstuff).
I just downloaded a "CSV" version of my PayPal history and I thought this
was weird: it put _everything_ (all fields, that is) in double-quotes --
even numerical fields. But then it didn't put the header fields in quotes.
And it did also put a trailing comma on each line (hmm).
PayPal's CSV has unescaped commas within a double-quoted string field, BTW.
That seems fairly logical as long as they're putting strings in double-quotes
(dumb and wasteful compared to escaping the occasional comma or backslash,
but I guess it's too legacy not to do).
Anyway. I don't expect there are hard answers to these sorts of questions but
if anyone knows if there's a BNF definition how popular apps, like, Micros~1
Excel interpret CSV, I could use some tips.
How CSV ever got to be any kind of text standard (over tab-delimited text)
is beyond me. CSV stinks: The probability of a comma occurring in text is
far greater than a tab character -- especially in many European currency
formats where "," is the decimal point and not ".".
--Todd
|
|
Message has 3 Replies:
12 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Database
|
|
|
|