python - Insert data from files into SQLite database -


i have sqlite database on form:

table1  column1 | column 2 | column 3 | column 4 

i want populate database data stored in hundred .out files in form, every file has millions of rows:

value1;value2;value3;value4; 2value1;2value2;2value3;2value4; ... etc 

is there fast way populate database these data? 1 way read in data line line in python , insert, there should faster way input whole file?

bash, sqlite, python preferrably

sqlite has .import command.

.import file table import data file table

you can use (shell).

for f in *.out     sqlite3 -separator ';' my.db ".import $f table1" done 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -