On Fri, 5 Feb 2010 09:18:27 -0500, "Paul Craven"
<pcra...@yorku.ca> 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?

Yes, it is possible.
The easiest way is to use fossil 
http://www.fossil-scm.org/

Alternatively, you can use od to compose the X'hexhex'
literal which you have to feed into the command line sqlite3
program.

(One line, shell quoting not 100% correct, untested):

f=thefilename ; echo "INSERT INTO t1 (name,contents) VALUES
('$f',X'$(od -A n -t x1 $f|tr -d '\r\n\t ')')" | sqlite3
your.db
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to