Hello, I've tested the improved ".import" command and it seems that there is a bug with empty not-quoted field: $ cat empty.csv A|B | $ ./a.out SQLite version 3.8.0 2013-06-28 23:55:45 sqlite> .import empty.csv test empty.csv:2: expected 2 columns but found 1 - filling the rest with NULL sqlite>
I am not sure, but it seems to be here: }else{ csv_append_char(p, c); // FIXME while( (c = fgetc(p->in))!=EOF && c!=cSep && c!='\n' ){ Regards. On Thu, Jun 27, 2013 at 1:01 AM, Richard Hipp <d...@sqlite.org> wrote: > On Wed, Jun 26, 2013 at 6:23 PM, RSmith <rsm...@rsweb.co.za> wrote: > >> I have done ludicrous amounts of testing and evaluating imports for and >> from CSVs >> > > I made a go at improving the CSV importer for the upcoming SQLite 3.8.0 > release. Please see the latest trunk check-in. Your expert feedback would > certainly be welcomed here. > > Note that in the new ".import" command, the table named in the second > argument need not exist now, and the shell will create it for you > automatically, giving it column names as determined by the first row of the > CSV file. That seemed like it might be a handy feature. > > The other changes to the new ".import" are that it issues error messages > (but tries to continue muddling through) if the input does not conform to > rfc4180, and it correctly handles quoted data that extends across multiple > lines or that contains embedded commas. > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > 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