3 ms·
"Excel can easily export CSV files, which are easy to parse" 'CSV' and 'easy to parse' do not go together that well http://en.wikipedia.org/wiki/Comma-separate
by Someone 14y ago
"Excel can easily export CSV files, which are easy to parse"
'CSV' and 'easy to parse' do not go together that well http://en.wikipedia.org/wiki/Comma-separated_values#Toward_standardization http://en.wikipedia.org/wiki/Comma-separated_values#Toward_s... also is instructive:
Nevertheless, RFC 4180 is an effort to formalize CSV. It defines the MIME type "text/csv", and CSV files that follow its rules should be very widely portable.
[...]
Each record "should" contain the same number of comma-separated fields.
[...]
Fields containing a line-break, double-quote, and/or commas should be quoted.
[...]
The format is simple and can be processed by most programs that claim to read CSV files.
- Groxx 14y ago$ irb >> require 'csv' # => true >> CSV.parse(file) ^ works every time I've tried it. Systems which export mangled data to CSV probably do so elsewhere, so CSV isn't special there, and CSV is really really simple to escape well enough that any decent parser won't have any problems at all.