SQLite Export

Description

SQLiteExport is a program to easily export data from a SQLite database. You can enter database, outputfile name and output type, and specify a table or a custom sql command.

You can easily automate export tasks with SQLiteExport, as you can execute the program from within a batch file and have all freedom to specify custom sql commands.

SQLiteExport is available for Linux and Windows.

Features

Download

Download the executables and sourcecode here.

Windows executable (zip, 1.3 MB)

Linux executable (commandline only at the moment, zip, 180 KB)

C++ sourcecode (zip, 1.0 MB)

Screenshots

Click to enlarge the following screenshots.

Usage

User interface

Usage of the user interface is easy and intuitive: select a database, choose a filename for the output file. The correct mode is automatically selected. Then choose a table or enter a custom SQL command. Press "Export" and wait until the export is finished.

Command line program

The command line version of the program has the following syntax.

sqlite_export_cmd -database DATABASE -output FILENAME -table TABLENAME [-mode MODE]
sqlite_export_cmd -database DATABASE -output FILENAME -sql SQLCOMMAND  [-mode MODE]
sqlite_export_cmd -help

Available parameters:

-database DATABASEThe name of the SQLite database.
-output FILENAMEThe filename of the output file.
-table TABLENAMETable name of the table to be exported.
-sql SQLCOMMANDA custom sql command
-mode MODE The output format, optional. If mode is not provided, the program guesses the right mode based on the extension of the filename. For MODE, choose from:
tabsA tab separated file
csvA command separated file
xlsAn Excel file
htmlA html file
screenShow results on screen
-helpIf parameter -help is provided, information about the usage is printed.

You have to choose one of the two parameters -table or -sql. If one of the parameter values contains spaces, enclose the parameter value with double quotes.

Examples:

sqlite_export_cmd -database data.db -output myoutput.xls -table mytable
sqlite_export_cmd -database data.db -output data.csv -sql "SELECT * FROM tbl;"
sqlite_export_cmd -database data.db -mode html -output page.html -table address
sqlite_export_cmd -database "other database.db" -mode screen -table addresses
sqlite_export_cmd -help

Code

The code is created in C++ and wxWidgets using the CodeBlocks IDE. The code is crossplatform and can be compiled for different platforms.

The source code contains two projects: one for the commandline program, and one for the user interface.

License

SQLite Export is open source and can be used under the MIT license.

Author

This program is created by Jos de Jong.
May 2010