How about (for a start):

for i in *.txt; do sqlite3 dir.db "insert into texts values('$i', '`cat 
$i`');"; done

Probably there shouldn't be any single quotes in the contents.

Ben G


> Given table texts(filename text, contents blob) and a directory of plain 
> text files, is it possible (using the command line interface alone) to 
> populate the table with the names and contents of all the text files, one 
> file per record?

> Thanks in advance, Paul Craven 


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to