problem:import csv data

Miki Tebeka miki.tebeka at gmail.com
Tue Sep 13 15:09:59 CEST 2011


.separator (and .import) are not SQL commands but "sqlite3" commands.
You can get the same effect with the following code:

    with open('/tmp/data.csv') as fo:
        reader = csv.reader(fo)
        cur.executemany('INSERT INTO quote VALUES (?, ?, ?, ?, ?, ?, ?)'), reader)

HTH
--
Miki Tebeka <miki.tebeka at gmail.com>
http://pythonwise.blogspot.com



More information about the Python-list mailing list