On Mon, 9 Jun 2008, Francesco Pietra wrote:

> [EMAIL PROTECTED]:~/sqlite$ sqlite biology_text.txt (text file)

This in incorrect syntax. You cannot import text or other data when 
invoking sqlite. You need to invoke sqlite with the name of a new or 
existing sqlite database, then import your data into that database. For 
instance, to create a new database called 'newdb':

sqlite3 newdb

To open an existing sqlite database called 'olddb':

sqlite3 olddb

Once you create a new db or open an existing one, you can import the data. 
First use CREATE TABLE syntax to create the table(s) to hold your data, if 
is does not already exist.

Then set the separator/delimiter in your text file(s):

.separator STRING

where STRING is the separator character.

Then import the data from a text file FILE into a table called TABLE:

.import FILE TABLE

See this for details on the commands available for the cmd line tool:

  http://www.sqlite.org/sqlite.html

Chris

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christopher F. Martin
School of Medicine
Center for Digestive Diseases & Nutrition
CB# 7555, 4104 Bioinformatics Bldg.
University of North Carolina at Chapel Hill
Chapel Hill, North Carolina 27599-7555
Phone: 919.966.9340       Fax: 919.966.7592
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


On Mon, 9 Jun 2008, Francesco Pietra wrote:

> Hi:
> To start with I installed sqlite 2.8.17 from Debain Linux lenny. I
> know about 3.5.9: I'll come to later.
>
> I am tired from using the database Asksam though the Windows emulator
> wine. At the moment it does not work. I had previously expoted thre
> Asksam files as
>
> text file
>
> text-delimited file .txt
>
> text-delimited file .csv
>
> Iin the latter two cases
> delimter: space
> text qualifier: '
> Single-line filed
> All fields
> Actually there are only a few fields ([  ]) in my files, for 'biology'
> none, only free text.
>
> Now I tried
>
> [EMAIL PROTECTED]:~/sqlite$ sqlite biology_text.txt (text file)
> Unable to open database "biology_text.txt": file is encrypted or is
> not a database
>
> [EMAIL PROTECTED]:~/sqlite$ ls -l
> total 1448
> -rwxrwxrwx 1 francesco francesco 1471942 2008-06-09 08:04 biology_text.txt
> -rwxrwxrwx 1 francesco francesco    1260 2008-06-09 07:53 biology.txt
> (text-delimited)
>
> [EMAIL PROTECTED]:~/sqlite$ sqlite biology.txt
> Unable to open database "biology.txt": file is encrypted or is not a database
>
> [EMAIL PROTECTED]:~/sqlite$ sqlite biology.csv
> Unable to open database "biology.csv": file is encrypted or is not a database
>
> [EMAIL PROTECTED]:~/sqlite$ sqlite -separator , biology.db ".import
> biology.csv biologytable"
> unknown command or invalid arguments:  "import". Enter ".help" for help
> [EMAIL PROTECTED]:~/sqlite$ sqlite -separator , biology.db ".import
> biology.csv biologytable"
>
> I could also export from Asksam as *.html *.html *.rtf
> or text-delimited *.dat *.prn
>
> I understand these are naive questions for sqlite users. Be patient. Thanks
>
> francesco pietra
> -- 
> Dr Francesco Pietra
> Professor of Chemistry
> Accademia Lucchese di Scienze, Lettere e Arti, founded in 1594
> Palazzo Ducale
> 55100 Lucca (Italy)
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

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

Reply via email to