Search This Blog

Wednesday, August 27, 2014

SQLITE to CSV on Mac

Open Terminal

cd to directory with sqlite database in it

 sqlite3 dbname

sqlite> .headers on
sqlite> .mode csv
sqlite> .output test.csv
sqlite> select * from tbl1;
sqlite> .output stdout

source:  http://stackoverflow.com/questions/6076984/how-to-export-the-results-of-my-query-to-csv-file-sqlite

No comments: