Click here to Skip to main content
11,716,249 members (89,325 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Android Sqlite CSV
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 25-Mar-13 0:06am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The command line version of the export database 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 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.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 599
1 Richard MacCutchan 280
2 Maciej Los 275
3 OriginalGriff 160
4 F-ES Sitecore 135
0 Sergey Alexandrovich Kryukov 1,003
1 Richard MacCutchan 430
2 CHill60 415
3 Maciej Los 399
4 OriginalGriff 385

Advertise | Privacy | Mobile
Web03 | 2.8.150901.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100