Liste des Groupes | Revenir à l c |
BGB <cr88192@gmail.com> writes:OK, looked...On 12/5/2024 9:16 AM, Tim Rentsch wrote:CSV files *can* have commas in data fields, and there are well-definedBGB <cr88192@gmail.com> writes:>
[considering .csv files and how to process them]
>Brings up the thought of how, ASCII has a bunch of controlThat would have been a horrible decision.
characters, but generally only a small number of them are used:
\r, \n, \t, \b
\e, \a, \v, \f (sometimes / rarely)
>
For CSV, we used ',' (a printable ASCII character) for something
that (theoretically) could have used \x1E (Record Separator).
Well, ASCII has all of these control characters, with assigned uses,
and we use only a few of them...
>
But, yeah:
Pros of comma: Easy to type, plain text, ...
Cons of comma: AFAIK, CSV files often can't have commas in data fields.
ways to represent them. For example, this line has three fields:
one,"two,three",four
And there are additional rules for fields containing quotation marks.
See <https://www.ietf.org/rfc/rfc4180.txt> for the most widely accepted
specification.
Note that RFC 4180 specifies CRLF line endings. Many of the CSV files
I've dealt with use LF instead.
Encoding considerations:
As per section 4.1.1. of RFC 2046 [3], this media type uses CRLF
to denote line breaks. However, implementors should be aware that
some implementations may use other values.
[...]
Les messages affichés proviennent d'usenet.