Hello,
May I suggest a patch ?

-- shell.c 2014-05-26 18:51:40.000000000 +0200
+++ shell.orig.c 2014-05-26 18:50:37.000000000 +0200
@@ -1917,8 +1917,6 @@
     if( c=='\n' ){
       p->nLine++;
       if( p->n>0 && p->z[p->n-1]=='\r' ) p->n--;
-    }else if( !p->z && c==cSep ){
-      csv_append_char(p, 0);
     }
     p->cTerm = c;
   }

Regards.

On Sat, May 24, 2014 at 9:46 AM, gwenn <gwenn.k...@gmail.com> wrote:
> Hello,
> When the first value of the first line is empty, .import fails:
> $ echo '|test' > ko.csv
> $ echo '""|test' > ok.csv
> $ sqlite3
> SQLite version 3.8.4.3 2014-04-03 16:53:12
> sqlite> .import ko.csv test
> ko.csv: empty file
> sqlite> .import ok.csv test
> sqlite>
>
> An error happens also when the table already exists:
> sqlite> create table test (id text, data test);
> sqlite> .import ko.csv test
> ko.csv:1: expected 2 columns but found 1 - extras ignored
> sqlite>
>
> Maybe CSVReader.z should be pre-allocated ?
>
> Regards.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to