Re: sqlite-users Digest, Vol 146, Issue 27

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: sqlite-users Digest, Vol 146, Issue 27

Balaji Ramanathan
On Thu, Feb 27, 2020 at 6:00 AM <
[hidden email]> wrote:

>   18. Cannot export 'sqlite3' file to CSV (Rachael Courts)
> From: Rachael Courts <[hidden email]>
> To: "[hidden email]" <
> [hidden email]>
> Cc:
> Bcc:
> Date: Thu, 27 Feb 2020 01:05:50 +0000
> Subject: [sqlite] Cannot export 'sqlite3' file to CSV
> Hi All,
>
> I'm a couple of months into my PhD, studying bioacoustics. I am using
> SQLiteStudio to open '.sqlite3' files, which I need to convert to CSV files
> to import into MATLAB for further analyses.
>
> Currently I have attempted the data export function, selecting which
> database and table I would like to export, however no option for 'CSV'
> exportation is available. The only options that appear are 'JSON, SQL,
> HTML, and PDF' which can't be read into excel.
>
> I have also attempted the queries tab in SQLiteStudio, in an attempt to
> write code for exportation. This did not work.
>
> I also attempted opening the command window on my computer, to change the
> '.sqlite3' file to 'CSV' but it seems that the '.sqlite3' file doesn't have
> a '.db' attached, and therefore will not open in the command window for
> editing.
>
> I'm seeking ANY advice on how to export these files into CSV, so they can
> be read in excel, and easily imported into MATLAB.
>
> I've attached an example file, if this helps.
>
> I hope to hear from someone soon,
> Rachael
>

    I am not sure exactly what you are trying to do, but SQLiteStudio does
provide you the ability to export as CSV.  Are you trying to export just
the table or the table + table indexes + table triggers?  CSV export is
supported under Data ->Export only for table export (not for table +
indexes or table + triggers, etc.).

    If you are trying to export the whole database, it is best to think of
a database with multiple tables as a spreadsheet with multiple tabs.  You
can export each tab as a CSV, but you can't export an entire multi-tab
spreadsheet as one CSV.  Same thing applies to databases.  You can either
export each table as a CSV, then import them into multiple tabs of a
spreadsheet and use vlookups to relate the data into one bigger dataset
with more columns - or better yet, write some SQL to "join" the tables and
export the results of that query as a CSV for import into a spreadsheet.

Balaji Ramanathan
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users