On 4 August 2010 14:57, john knops <jkn...@australiaonline.net.au> wrote:
> Thanks for the prompt reply.
> What form should the file take. I've tried enclosing the data for each
> column in double quotes and separating them with either a comma, tab or
> space but I get an error "expected 5 columns but only found 1. Using | I
> get "datatype mismatch"

Difficult to say what is wrong without seeing what you have tried, but
here is an example:

C:\Tmp>copy con tst.txt
1,2,3,4
5,6,7,8
9,10,11,12
13,14,15,16^Z
        1 file(s) copied.
C:\Tmp>
C:\Tmp>sqlite3
SQLite version 3.6.11
Enter ".help" for instructions
sqlite> create table tst( a, b, c, d );
sqlite> .import tst.txt tst
tst.txt line 1: expected 4 columns of data but found 1
sqlite> .separator ,
sqlite> .import tst.txt tst
sqlite> select * from tst;
1,2,3,4
5,6,7,8
9,10,11,12
13,14,15,16
sqlite>

Different separators can be used; use .separator to indicate to sqlite
what to use.

> Also when I use .dump does it destroy the table or just copies it t a
> text file?

Creates output only

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

Reply via email to