On 23 August 2010 14:09, Peng Yu <pengyu...@gmail.com> wrote: > Hi, > > Since I don't find a command that can directly export the data into a > file, I use pipe to export data from sqlite3 to a tsv file. Is there a > better way to do so?
There is an alternative to using pipe: http://www.sqlite.org/sqlite.html and look for "Writing results to a file" on that page. > > $ cat main.sh > #!/usr/bin/env bash > > rm -rf main.db3 > sqlite3 main.db3 '.read main.sql' > main.txt > > $ cat main.sql > create table A (name text, position integer); > > insert into A values('a', 1); > insert into A values('b', 10); > .separator ',' > select * from A; > $ ./main.sh > $ cat main.txt > a,1 > b,10 > > > -- > Regards, > Peng Regards, Simon _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users