On 25/09/2009, at 7:47 AM, Jay A. Kreibich wrote: > 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.
> 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. I see this said occasionally as a discussion on theory, but I disagree. In reality, in the thousands of CSV files I've dealt with over the years, they all follow the same standard: 1. Rows are delimited by a new line (return and/or line feed). 2. Columns are delimited by a comma. 3. "Quoted text" is treated as one value item, including any commas or new lines within it. 4. A double quote "" is used to put a quote within quotes. That's it. Everything I've seen uses this. Some don't need delimiters in values, so they don't need quotes, but the encompassing specification works for all cases. It's not that big a deal for SQLite to support it, so it should. Tom BareFeet -- Comparison of SQLite GUI applications: http://www.tandb.com.au/sqlite/compare/?ml _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users