csv - Pass parameter from batch file to sqlite script -
i want batch import multiple *.csv files sqlite3 database using batch command line.
i have batch file(loader.bat) calls loader.sql import csv file test.db (using sqlite3.exe).
sqlite3.exe test.db ".read loader.sql"
loader.sql sqlite script imports data.csv table (tb_data)
.import data.csv tb_data
this works importing single file (data.csv). want import *.csv files (eg data123.csv, data456.csv, data789.csv) in folder same table(tb_data).
i thinking of using loop in batch script iterate through files.
for %%a in (*.csv) ( echo %%a sqlite3.exe test.db ".read loader.sql" )
how pass parameters batch script sqlite script(loader.sql)?
just combine csv
files 1 first , use original command load that:
copy *.csv combined.cv
Comments
Post a Comment