Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I am developing simple an Android app where data will be export from sqlite to csv.Please explain how this can do?

Thanks in advance

Neeraj Rathi
Posted

1 solution

The command line version of the export database has the following syntax.

SQL
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 DATABASE : The name of the SQLite database.
-output FILENAME : The filename of the output file.
-table TABLENAME : Table name of the table to be exported.
-sql SQLCOMMAND : A custom sql command
-mode MODE : The output format, optional.
If mode is not provided, the program will guess the right based on the extension of the filename.
Following are the diffrent values for MODE.
tabs: A tab separated file
csv : A command separated file
xls : An Excel file
html: A html file
screen: Show results on screen

-help : If parameter -help is provided, information about the usage is printed.


Please refer this LINK for android code required to dump an SQLite database to a file on the SD card in CSV format.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900