bash - SQLITE3 Importing .csv Files with Different Number of Columns -
i have thousands of .csv
files each row can contain either 18 or 23 columns. file contains rows 18 columns, , rows 23 columns.
i'm using bash script run loop , import each file sqlite3 database running:
sqlite3 options.db ".mode csv data" ".import '$f' data"
and database schema has 23 columns.
problem: when sqlite3
encounters row 18 columns, prints on terminal message saying expected 23 found 18 - filling rest null
, , proceeds next row. rows saved, terminal has print message each row, , since there millions of rows, slows down importing process lot.
question: how can suppress warning message sqlite3
? if cannot suppress it, how can avoid in first place?
thanks helping! :d
Comments
Post a Comment