Sorry, didn't read long enough.  Fire up sqlite3 and type ".help".

To "export" a table, you can do:

  .output /tmp/export
  select * from TABLE;
  .output stdout

To import, you do:

  .import /tmp/export TABLE

You can adjust the separator using .separator.  The inverse of .dump
would be .read.

-scott


On 3/9/07, Scott Hess <[EMAIL PROTECTED]> wrote:
On 3/9/07, Gunnar Roth <[EMAIL PROTECTED]> wrote:
> Anderson, James H (IT) schrieb:
> > I need to "export" a table to a file in the same format as used by
> > .import, but I don't see any such cmd. Am I missing something, or does
> > such a cmd just not exist?
>
> Maybe its dumb but its called .dump ;-)

So, that's the third suggestion of .dump.  To recreate the database
from .dump, you simply execute the sql commands within - which is not
what .import does at all!

The inverse of .import would be select!  By this I mean that if you
have a table, you do something like:

   echo "SELECT * FROM TABLE;" | sqlite3 my.db > export.file

to later import that data, at the sqlite3 command-line you'll do
".import export.file TABLE"

-scott


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to