News for hackers. Stuff that matters.
Re:Excel and SQL by Someone on Thursday May 23, 2013 @07:09PM (#5760147)
"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_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.

Re:Excel and SQL by Groxx on Friday May 24, 2013 @03:13AM (#5761593)

  $ 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.