Hi Richard,

The sqlite3 utility allows a *single* dot-command on the command line
itself.
You can have an unlimited number of commands in a separate text file,
though.

   http://www.sqlite.org/sqlite.html

So, using Windows syntax, you can have something like:

===========================
Set MyTempFile=%temp%\Mytemp.tmp

echo .separator ,>%myTempFile%
Echo .output thisisit.csv     >>%myTempFile%
Echo select * from iotemplate;>>%myTempFile% 
Echo .output stdout           >>%myTempFile%

Sqlite3.exe ioimport.db3 ".read %myTempFile%"

Del  %mytempfile% >nul
============================

If you're using linux/unix, you can redirect input to the your shell
script and avoid the temporary file.

Hope this helps,
    Donald 


-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Nero
Sent: Monday, March 30, 2009 11:12 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] export table to csv

All,

I can successfully import a databese via command line with:

sqlite3.exe -separator , ioimport.db3 ".import Temp.csv iofromexcel"

Now i am trying to export a table in the db with:

sqlite3.exe ioimport.db3 .mode csv .separator , .output thisisit.csv
"select
* from iotemplate;" .output stdout

This does not work and I have tried all solutions possible. Can someone
lead me in the right direction on how to do this via command line

Thanks in advance!
_______________________________________________
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

Reply via email to