mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
sqlite-utils insert --sniff option, closes #230
This commit is contained in:
parent
1e9eb875a6
commit
99ff0a288c
7 changed files with 74 additions and 9 deletions
10
docs/cli.rst
10
docs/cli.rst
|
|
@ -498,7 +498,13 @@ A progress bar is displayed when inserting data from a file. You can hide the pr
|
|||
Alternative delimiters and quote characters
|
||||
-------------------------------------------
|
||||
|
||||
If your file uses a delimiter other than ``,`` or a quote character other than ``"`` you can specify them using the ``--delimiter`` and ``--quotechar`` options.
|
||||
If your file uses a delimiter other than ``,`` or a quote character other than ``"`` you can attempt to detect delimiters or you can specify them explicitly.
|
||||
|
||||
The ``--sniff`` option can be used to attempt to detect the delimiters:
|
||||
|
||||
sqlite-utils insert dogs.db dogs dogs.csv --sniff
|
||||
|
||||
Alternatively, you can specify them using the ``--delimiter`` and ``--quotechar`` options.
|
||||
|
||||
Here's a CSV file that uses ``;`` for delimiters and the ``|`` symbol for quote characters::
|
||||
|
||||
|
|
@ -510,7 +516,7 @@ You can import that using::
|
|||
|
||||
$ sqlite-utils insert dogs.db dogs dogs.csv --delimiter=";" --quotechar="|"
|
||||
|
||||
Passing either ``--delimiter`` and ``--quotechar`` implies ``--csv``, so you can omit that option.
|
||||
Passing ``--delimiter``, ``--quotechar`` or ``--sniff`` implies ``--csv``, so you can omit the ``--csv`` option.
|
||||
|
||||
.. _cli_insert_replace:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue