If you have a file that conforms fully to the RFC, I honestly don't see the
problem.  Your examples do not meet the RFC rules.  If the rule does not
address leading spaces outside the quoted text, then the input file should
not contain spaces there as they will be ignored.

Over the years I have written several CSV parsers in three of four different
languages at least and have never had a problem parsing a VALID CSV file.  I
have never used the SQLite command line utility for such so cannot judge its
functionally.  I use my own parser or someone else's'.

Fred

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org]on Behalf Of Wilson, Ronald
Sent: Friday, September 25, 2009 1:38 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Tedious CSV import question


> > Still, the RFC does not
> > address how to handle rows like this:
> >
> > 1234,abc"123",abc
> > 1235,""123,abc
>
> Both violate the format as defined.  Generate an error message or
> interpret them any way that suits you.
>
> > What are you supposed to do with those?  It is not clear.  Also, are
> > you
> > supposed to strip the quotes upon consuming the field?  Are you
> > supposed
> > to un-escape escaped quotes?
> >
> > "1234" -> 1234 or "1234" ?
>
> 1234
>
> > "15""" -> 15" or 15"" or "15""" or "15"" ?
>
> 15"
>
> Simon.

I can appreciate common sense answers, but the RFC doesn't specify those
answers.  The RFC seems to only address the formatting of the CSV file,
not the consumption of it.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to