How to transfer the output of an SQLite query into a spreadsheet (Excel)



  • enter image description here

    After running the query, I am getting 4 rows of output. How to transfer the same into an Excel file. I know I can do this manually, but there should be a method. enter image description here

    Unable to figure out how to access command line interface so that I can try with this code as per the above StackExchange post:

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

    enter code here



  • you will need to have SQLite3 installed on your system, the database in question on your system and then navigate to the installation directory (or have the program directory in your PATH) before you type the sqlite command. You could also see if your DB Browser GUI program has the ability to export directly to a CSV. Or, if you do really only do expect to deal with 4 lines of data at a time, you can probably control-A (highlight all), control-C (copy) and then paste into excel directly.

    As your question is more of a how-do-i-use-a-dos-prompt question than a database question, further follow-up should probably be on one of the other stackexchanges (stack overflow?) or by reading the documentation for SQLite.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2