> > I read the RFC last night
> 
> Oh, my...
> 
> Programming in Lua has a nice, concise example regarding CSV parsing
> (near the end of the page):
> 
> http://www.lua.org/pil/20.4.html
> 
> Quote:
> 
> To break a CSV into an array is more difficult, because we must avoid
> mixing up the commas written between quotes with the commas that
> separate fields. We could try to escape the commas between quotes.
> However, not all quote characters act as quotes; only quote characters
> after a comma act as a starting quote, as long as the comma itself is
> acting as a comma (that is, it is not between quotes). There are too
> many subtleties. For instance, two quotes may represent a single
> quote, two quotes, or nothing:
> 
> "hello""hello", "",""
> 
> Clear as mud? :D

Yeah.  The clearest thing in the RFC is the ABNF grammar.  However, even
that leaves out common cases like white space outside of quoted fields,
which most people would expect to be trimmed.  Also, I think most people
would expect leading/trailing white space to be trimmed, even in
unquoted fields.

I think I'll break out my flex/lemon tools tonight and make a CSV
parser.

RW 

Ron Wilson, Engineering Project Lead
(o) 434.455.6453, (m) 434.851.1612, www.harris.com

HARRIS CORPORATION   |   RF Communications Division
assuredcommunications(tm)
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to