Skip to content

Help/Advice: Exporting a table/query as a csv file from command line #3499

Answered by gaiking-uk
gaiking-uk asked this question in Q&A
Discussion options

You must be logged in to vote

SQLite 3 (via ODBC Connector)

It turns out that I actually had an app that could do this all along...

  • I use ch-werner's SQLite ODBC driver to enable Excel to import and query SQLite databases
  • This app comes with SQLite3
  • You can use SQLite3 on the command line to run a query and save the output as a CSV file, for example...
SQLite3 -headers -csv Database.DB "SELECT * FROM table;" > Results.csv

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@gaiking-uk
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by gaiking-uk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants