Implemented --tsv option, closes #41

This commit is contained in:
Simon Willison 2019-07-18 21:50:38 -07:00
commit 09316835e6
3 changed files with 69 additions and 9 deletions

View file

@ -187,8 +187,8 @@ The ``--nl``, ``--csv`` and ``--table`` options are all available.
.. _cli_inserting_data:
Inserting data
==============
Inserting JSON data
===================
If you have data as JSON, you can use ``sqlite-utils insert tablename`` to insert it into a database. The table will be created with the correct (automatically detected) columns if it does not already exist.
@ -249,6 +249,17 @@ This also means you pipe ``sqlite-utils`` together to easily create a new SQLite
207368,920 Kirkham St,37.760210314285,-122.47073935813
188702,1501 Evans Ave,37.7422086702947,-122.387293152263
Inserting CSV or TSV data
=========================
If your data is in CSV format, you can insert it using the ``--csv`` option::
$ sqlite-utils insert dogs.db dogs docs.csv --csv
For tab-delimited data, use ``--tsv``::
$ sqlite-utils insert dogs.db dogs docs.tsv --tsv
Upserting data
==============