On 16 Aug 2010, at 12:40am, Peng Yu wrote:

> This is called here document in bash. You can mix sqlite3 code with bash code.

Thank you.  I did not know about this function.  I assume this page

http://tldp.org/LDP/abs/html/here-docs.html

describes what you're doing.

> But my question on how to read from stdin is still not answered.

Make the following two changes

sqlite3 main.db <<EOF                 <----- CHANGE
.import file.txt test                 <----- CHANGE

I believe that you also have a problem with your data file, file.txt.  Although 
you may have used tabs when you typed it out, the text you pasted into your 
post has spaces in instead of tabs.  I corrected this problem and your script 
worked.

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

Reply via email to