I needed to get some data from SQLite database this week to import into MySQL, while doing that I thought this would make a good tip, just in case you don't know how this is done.
It's nice a simple, just follow these steps, once you have logged into your database.
- sqlite> .headers on
- sqlite> .mode csv
- sqlite> .output datafile.csv
- sqlite> select * from your_table;
Your query may change if you only want certain columns, or you may not want the headers, but as you can see you can easily change this to your suiting.
Then it will come back to your prompt. When you exit out you will then be able to see your csv file. You can then copy this to where ever you like and import it in.
I am always interested in feedback so please feel free to add any comments, or you can mail me here. If you would like to submit a quick tip with full credit and links back to your site then also feel free to contact me.