Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Luuk
You are correct, but i'm not using sqlite enough to know (or remember) it also has a sqlite_master :-):-) On 08-12-17 16:48, Donald Griggs wrote: For windows, I think the following would work: sqlite3 %DB% -batch "SELECT TBL_NAME FROM sqlite_master WHERE type=='table' order by tbl_name;"

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Donald Griggs
For windows, I think the following would work: sqlite3 %DB% -batch "SELECT TBL_NAME FROM sqlite_master WHERE type=='table' order by tbl_name;" >%temp%\dump.tmp for /f "usebackq" %%i in (`type %temp%\dump.tmp`) do sqlite3 %DB% -batch ".mode tabs" -batch "SELECT * FROM %%i "

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Luuk
On 08-12-17 14:52, Luuk wrote: On 08-12-17 14:13, Simon Slavin wrote: On 8 Dec 2017, at 7:02am, Peng Yu wrote: I'd like to dump all the tables to separate files, one table one file. Each file should be in TSV format. Is there a convenient way to do so in sqlite3?

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Simon Slavin
On 8 Dec 2017, at 1:58pm, Peng Yu wrote: > Could you provide the working code for bash (on Mac OS X or linux)? Thanks. Something like this … sqlite3 myDatabase.sqlite > myTable.tsv << EOS .mode tabs select * from myTable; EOS The first EOS must be at the very

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Peng Yu
Could you provide the working code for bash (on Mac OS X or linux)? Thanks. On Fri, Dec 8, 2017 at 7:52 AM, Luuk wrote: > On 08-12-17 14:13, Simon Slavin wrote: >> >> >> On 8 Dec 2017, at 7:02am, Peng Yu wrote: >> >>> I'd like to dump all the tables to

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Luuk
On 08-12-17 14:13, Simon Slavin wrote: On 8 Dec 2017, at 7:02am, Peng Yu wrote: I'd like to dump all the tables to separate files, one table one file. Each file should be in TSV format. Is there a convenient way to do so in sqlite3? There’s no direct output from the

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Simon Slavin
On 8 Dec 2017, at 7:02am, Peng Yu wrote: > I'd like to dump all the tables to separate files, one table one file. > Each file should be in TSV format. > > Is there a convenient way to do so in sqlite3? There’s no direct output from the SQLite library to produce TSV

[sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Peng Yu
I'd like to dump all the tables to separate files, one table one file. Each file should be in TSV format. Is there a convenient way to do so in sqlite3? -- Regards, Peng ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org