On Thu, Sep 24, 2009 at 09:12:20PM +0100, Simon Slavin scratched on the wall:

> The .import command does not handle quoted fields correctly, as has  
> recently been stated on this list.  

  I think it would be more fair to say that the .import command has
  chosen not to support quoted fields.  There is a big difference
  between not doing something and not doing something correctly.

  The bigger issue is that CSV isn't really a format, but more of a
  loose idea.  Yes, many systems that use CSV choose to assign meaning
  to double quotations, but my first question to that is, "How do you put
  a double-quote into a value?"  Is it \" in a C-style escape, or maybe
  double characters ("") like SQL?  If the answer is \", why not just
  use \, in the first place?

  There are no answers to these questions because there is no standard.
  You can't even use the modern defacto of asking, "What does Microsoft
  do?"  Different versions of Excel (nevermind different products) have
  different answers to some of these questions.  Heck, IIRC, there are
  cases when the *same* version of Excel on different platforms has 
  different answers.

  It is a hard problem, but I suppose the real answer-- one that has
  been around since mainframes started to spit out CSV files-- is you
  need to either A) avoid CSV files, B) don't use commas and accept you
  can't put your deliminator into values, or C) assume you must
  massage the data if you're moving CSV files from product one to
  product two.

  But blaming the product is kind of pointless because their all
  different.  You might as well blame whatever exported the data for
  using the non-standard quote extension to CSV.

   -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to