Click here to Skip to main content
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 1: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 OriginalGriff 685
1 Maciej Los 290
2 Richard Deeming 185
3 Suvendu Shekhar Giri 184
4 Abhinav S 166
0 Sergey Alexandrovich Kryukov 9,678
1 OriginalGriff 9,135
2 Peter Leow 5,082
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 2,606

Advertise | Privacy | Mobile
Web01 | 2.8.150327.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