Documentation Source Text

Check-in [1728ebf59c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the "Export to Excel" subparagraph under "CSV Export" section of the CLI documentation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1728ebf59c6a715c06657279aefe0b6ede938e6280befc2b0ae76259dffa1747
User & Date: drh 2018-01-10 20:28:33.242
Context
2018-01-11
00:44
Add documentation on the edit() function and .excel command in the CLI. (check-in: 24c4bece59 user: drh tags: trunk)
2018-01-10
20:28
Add the "Export to Excel" subparagraph under "CSV Export" section of the CLI documentation. (check-in: 1728ebf59c user: drh tags: trunk)
19:39
Further tweaks to the cli.html document. (check-in: c27765f3b7 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/cli.in.
629
630
631
632
633
634
635



636
637
638
639
640


641





642
643
644



645
646
647
648
649
650
651
the default and can be omitted if the headers have not been previously
turned on.)

<p>The line ".once <i>FILENAME</i>" causes all query output to go into
the named file instead of being printed on the console.  In the example
above, that line causes the CSV content to be written into a file named
"C:/work/dataout.csv".




<p>The final line of the example (the ".system c:/work/dataout.csv")
has the same effect as double-clicking on the c:/work/dataout.csv file
in windows.  This will typically bring up a spreadsheet program to display
the CSV file.  That command only works as shown on Windows.  The


equivalent line on a Mac would be ".system open /work/dataout.csv".





On Linux and other unix systems you will need to enter something like
".system libreoffice /work/dataout.csv", substituting your preferred
CSV viewing program for "libreoffice".




<tcl>hd_fragment dump {.dump}</tcl>
<h1>Converting An Entire Database To An ASCII Text File</h1>

<p>Use the ".dump" command to convert the entire contents of a
database into a single ASCII text file.  This file can be converted
back into a database by piping it back into <b>sqlite3</b>.</p>







>
>
>




|
>
>
|
>
>
>
>
>
|
|
|
>
>
>







629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
the default and can be omitted if the headers have not been previously
turned on.)

<p>The line ".once <i>FILENAME</i>" causes all query output to go into
the named file instead of being printed on the console.  In the example
above, that line causes the CSV content to be written into a file named
"C:/work/dataout.csv".

<tcl>hd_fragment exexcel* {export to excel}</tcl>
<h2> Export to Excel </h2>

<p>The final line of the example (the ".system c:/work/dataout.csv")
has the same effect as double-clicking on the c:/work/dataout.csv file
in windows.  This will typically bring up a spreadsheet program to display
the CSV file.

<p>That command only works as written on Windows.  
The equivalent line on a Mac would be:

<tclscript>DisplayCode {
sqlite> (((.system open dataout.csv)))
}</tclscript>

<p>On Linux and other unix systems you will need to enter something like:


<tclscript>DisplayCode {
sqlite> (((.system libreoffice dataout.csv)))
}</tclscript>

<tcl>hd_fragment dump {.dump}</tcl>
<h1>Converting An Entire Database To An ASCII Text File</h1>

<p>Use the ".dump" command to convert the entire contents of a
database into a single ASCII text file.  This file can be converted
back into a database by piping it back into <b>sqlite3</b>.</p>