1. #1
    hackerman1 is offline Moderator
    Join Date
    Dec 2008
    Location
    Sweden
    Posts
    1,525

    Default How to convert an SQLite database to Excel

    Here is how to convert an SQLite database to Excel


    Note: this is just an example, you have to use your own filenames and paths etc !

    This conversion requires the command-line shell program SQLite:
    http://www.sqlite.org/2015/sqlite-sh...86-3080803.zip

    Commands and examples: http://www.sqlite.org/cli.html

    Info: SQLite Home Page


    Conversion

    Create a text file with the SQLite commands

    Code:
    .header off
    .mode csv
    .once "csv.txt"                                
    select * from log;
    Save it as SQLite to CSV.txt

    Note: Enter the name of the ouput-file on line 3: ("csv.txt")

    Create a bat-file with the commands

    Code:
    sqlite3 SQLite.db <  SQLite to CSV.txt
    Save it as SQLite to CSV.bat

    Note: Enter the path and name of the database-file: ("SQLite.db")
    In this example the SQLite-database is located in the same folder as the SQLite commandline-tool (sqlite3).


    Run SQLite to CSV.bat

    If you have a non-english version of the O/S you need to temporarily change the settings for "Decimal" to US-standard, which can easily be done with a reg-script.

    US-DECIMAL.reg

    Code:
    Windows Registry Editor Version 5.00
     [HKEY_CURRENT_USER\Control Panel\International]
    "sDecimal"="."
    "sThousand"=","
    You can run the reg-script and answer yes to the confirmations,
    or use this bat-file which runs the script without asking any questions.

    US-DECIMAL.bat


    Code:
    REGEDIT.EXE /S "US-DECIMAL.REG"
    Note: Enter the correct path to the reg-script

    Run US-DECIMAL.bat

    Start Excel
    Select "Data"
    "From Text"
    Select the output-file ( "csv.txt" )
    Select Filetype "Delimited"
    Next
    Mark "Comma"
    Next
    Finish
    OK

    When you have finished the conversion you have to restore the settings for "Decimal".

    SWEDISH-DECIMAL.reg

    Code:
    Windows Registry Editor Version 5.00
     [HKEY_CURRENT_USER\Control Panel\International]
    "sDecimal"=","
    "sThousand"="."

    SWEDISH-DECIMAL.bat


    Code:
    REGEDIT.EXE /S "SWEDISH-DECIMAL.reg"
    Note: Enter the correct path to the reg-script

    You can run the reg-script and answer yes to the confirmations,
    or use this bat-file which runs the script without asking any questions.

    Note: In this example all files are in the same folder as sqlite3...
    If you want to use files located elsewhere then (of course) you have to use the right paths.
    And the right filenames....
    Last edited by hackerman1; 10th March 2015 at 22:00.

  2. #2
    ruslanb629 is offline New Member
    Join Date
    Jun 2017
    Posts
    1

    Default

    You can convert SQLite to excel online in the following website

    sqlite.news

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22