I have a handy script that can handle that sort of input with extra spaces
(With the --strip option), and other stuff that csv .import doesn't always
deal well with:

https://github.com/shawnw/useful_sqlite_extensions/tree/master/tools

On Tue, May 21, 2019 at 6:14 AM Faheem Mitha <fah...@faheem.info> wrote:

>
> Hi,
>
> I'm seeing the same bug reported here, in an issue from 2009, supposedly
> fixed in 2014.
>
> https://www.sqlite.org/src/tktview?name=c25aab7e7e with the title:
> The ".import" command does not parse CSV correctly.
>
> I'm using Debian buster, with SQLite version 3.27.2-2.
>
> Here is a simple reproduction recipe. Consider the following simple CSV
> file.
>
> #######################
> comma.csv
> #######################
> somestuff, "some,stuff"
>
> Then one just needs to do
>
>     sqlite3 comma.db 'create table comma(foo, bar);' '.mode csv' '.import
> comma.csv comma' '.exit'
>
> Which gives the error message:
>
>     expected 2 columns but found 3 - extras ignored.
>
> As mentioned in that ticket, this is per the
> https://tools.ietf.org/html/rfc4180 standard.
>
> Pandas handles this case fine. I've not checked R.
>
> Should I attempt to reopen that ticket?
>
> Regards, Faheem
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to