Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

export query results to text file ?

Help
Monique S
2010-11-16
2013-05-14
  • Monique S
    Monique S
    2010-11-16

    I'm using the browser to sort through my google chrome history, and all works great.  But, is it possible to export the query results to a text file?  The standard ">" or ".output" commands don't seem to work; I get a syntax error.

    Many thanks in advance,
    -Monique

     
  • Jan Zumwalt
    Jan Zumwalt
    2010-11-20

    The command line version of sqlite supports the "list" command. I use the PDO version and am looking into a simular cmd - it would be nice!

    sqlite -list -separator ', ' db.db 'select * from thetable'

     
  • ThetaWave
    ThetaWave
    2011-07-11

    I would like to do this also. I don't know anything about SQL Lite, but do know a bit about SQL. I came across your browser when looking for a way to read a SQL lite DB file. How can I export the results to a csv or any other format? I don't want to export the entire database, just a set of results.

    @jwzumwalt1, what do you mean by PDO version? Do I need to have some version of sql lite to run that command?

     
  • Jens Miltner
    Jens Miltner
    2011-07-11

    For more information on the SQLite commandline tool, look here.
    The SQLite commandline tool even has a "CSV" mode where query results are output in CSV format, so you can easily get your query results as CSV files by redirecting output to a file.
    On Mac OS X and Linux, the sqlite tool will come preinstalled (or is at least part of the standard sqlite installation), on Windows, you'll have to download & install yourself.