You didn't mention which OS you're in. This works in Unix:

$ sqlite3 -help
Usage: sqlite3 [OPTIONS] FILENAME [SQL]
FILENAME is the name of an SQLite database. A new database is created
if the file does not previously exist.
OPTIONS include:
   -init filename       read/process named file
   -echo                print commands before execution
   -[no]header          turn headers on or off
   -bail                stop after hitting an error
   -interactive         force interactive I/O
   -batch               force batch I/O
   -column              set output mode to 'column'
   -csv                 set output mode to 'csv'
   -html                set output mode to HTML
   -line                set output mode to 'line'
   -list                set output mode to 'list'
   -separator 'x'       set output field separator (|)
   -nullvalue 'text'    set text string for NULL values
   -version             show SQLite version



$ sqlite3 -list -separator "  " test.sqlite "select * from a;"

1       one
2       two
3       three




I had a tab character inside the quotes after -separator

g

 

-----Original Message-----
From: Webb Sprague [mailto:webb.spra...@gmail.com] 
Sent: Monday, January 05, 2009 12:45 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] "meta command" via string via shell?

> If I understand correctly, all you need to do is write the desired
> commands out to a text file, then either direct stdin to the text
file,
> or use the '.read" command.

Yes, I could write the commands out to a file (ick!), but I don't
really want to add four lines and a whole lot of I/O.  I could also
use a "here document", but again, I was kind of hoping to do it all in
one string from the command line.  It is a common enough operation
that I am going to hold out for an answer to my original question.

Thanks though!

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

Reply via email to