On 5 Feb 2010, at 2:18pm, Paul Craven wrote:

> 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?

You could probably write a script to read one file in at a time.  It might be 
difficult to read more than one file in one go, because there's no simple way 
to pick a separator so you can tell where one file ends and another starts.

But I think I'd be more likely to write a script to read all the files I wanted 
and turn the contents of all the files into one long series of SQL commands.  
Then you could just use the command-line tool to execute that SQL file with 
.read.

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

Reply via email to