Anyone ?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Anyone ?

Richard-118

Well,

Did this:

sqlite3 test2.db
create Table T (A, B, C );
.separator ,
.import 'sqtest2.txt' T

It looks like it working, but the file size is still
4K and not 170 Megs.

Please note:
I exported this database as a Tab delimiter file,
then as a Comma, delimiter file...

** Got it to import, however it only imports the first record
ie:

sqlite> select * from T;
-180,90,NaN
sqlite>

There's a few more hundred thousands.....
is there suppose to be some kinda of loop statement
like repeat again..

TKS-
Richard
Reply | Threaded
Open this post in threaded view
|

RE: Anyone ?

Griggs, Donald

Richard,

No loop commands on your part are needed.

Did you receive Jens Miltner's post of 9:55am (UTC-4hr)?   Was it relevant?

-----------------------
Are you sure your text file has the correct line-endings? From a quick look
at the shell sources, it looks like the shell expects native line-endings
for the imported file. If the line-endings are not the native endings, the
entire file may be interpreted as a single line, skipping everything past
the first column values...

</jum>
-----------------------

Donald Griggs


Opinions are not necessarily those of Misys Healthcare Systems nor its board
of directors.


-----Original Message-----
From: Richard [mailto:[hidden email]]
Sent: Tuesday, October 04, 2005 11:10 AM
To: [hidden email]
Subject: [sqlite] Anyone ?

Reply | Threaded
Open this post in threaded view
|

Re: Anyone ?

Richard-118
Hi Don,
No, I did not received, any email from Jens Miltner's
in fact, I notice, that posting from the sqlite list, are becoming
very sparse in coming.... there are hours of gaps....
sometime nothing for a day.


Regards-
Richard


On Tue, 04 Oct 2005 11:26:32 -0400, Griggs, Donald  
<[hidden email]> wrote:

>
> Richard,
>
> No loop commands on your part are needed.
>
> Did you receive Jens Miltner's post of 9:55am (UTC-4hr)?   Was it  
> relevant?
>
> -----------------------
> Are you sure your text file has the correct line-endings? From a quick  
> look
> at the shell sources, it looks like the shell expects native line-endings
> for the imported file. If the line-endings are not the native endings,  
> the
> entire file may be interpreted as a single line, skipping everything past
> the first column values...
>
> </jum>
> -----------------------
>
> Donald Griggs
>
>
> Opinions are not necessarily those of Misys Healthcare Systems nor its  
> board
> of directors.
>
>
> -----Original Message-----
> From: Richard [mailto:[hidden email]]
> Sent: Tuesday, October 04, 2005 11:10 AM
> To: [hidden email]
> Subject: [sqlite] Anyone ?
>


Reply | Threaded
Open this post in threaded view
|

RE: Anyone ?

Griggs, Donald
In reply to this post by Richard-118
Regarding:  Hi Don,
No, I did not received, any email from Jens Miltner's in fact, I notice,
that posting from the sqlite list, are becoming very sparse in coming....
there are hours of gaps....
sometime nothing for a day.

I don't think it's unusual for there to be day-long gaps.  Others may know
more than I.  There are three sources of archives, BTW, listed at:
http://www.sqlite.org/support.html

But, more importantly, I included a copy of Miltner's paragraph in my email
which you *did* receive.   Is it relevant??????    What are your line
endings?


Donald Griggs


Opinions are not necessarily those of Misys Healthcare Systems nor its board
of directors.


-----Original Message-----
From: Richard [mailto:[hidden email]]
Sent: Tuesday, October 04, 2005 11:45 AM
To: [hidden email]
Subject: Re: [sqlite] Anyone ?
Importance: High

Reply | Threaded
Open this post in threaded view
|

Re: Anyone ?

Richard-118
Hi Don,

This what the text data contains, form importing....

-180,90,NaN ( carriage return )at the end of each record. ( nothing else. )
-179.917,90,NaN
-179.833,90,NaN
-179.75,90,NaN
-179.667,90,NaN
-179.583,90,NaN
-179.5,90,NaN
-179.417,90,NaN
-179.333,90,NaN
-179.25,90,NaN
-179.167,90,NaN
-179.083,90,NaN
-179,90,NaN
-178.917,90,NaN
-178.833,90,NaN
-178.75,90,NaN
-178.667,90,NaN
-178.583,90,NaN
-178.5,90,NaN
-178.417,90,NaN
-178.333,90,NaN
-178.25,90,NaN
-178.167,90,NaN
-178.083,90,NaN
-178,90,NaN
-177.917,90,NaN

--

Richard
CMS
Reply | Threaded
Open this post in threaded view
|

Re: Anyone ?

Gerald Dachs
On Tue, 04 Oct 2005 13:56:08 -0400
Richard <[hidden email]> wrote:

> Hi Don,
>
> This what the text data contains, form importing....
>
> -180,90,NaN ( )at the end of each record. ( nothing else. )

on unix/linux it should be line feed not carriage return

Gerald
Reply | Threaded
Open this post in threaded view
|

Re: Anyone ?

Dennis Cote
In reply to this post by Richard-118
Richard wrote:

> Hi Don,
>
> This what the text data contains, form importing....
>
> -180,90,NaN ( carriage return )at the end of each record. ( nothing
> else. )
> -179.917,90,NaN
> -179.833,90,NaN
> . . .

Richard,

Here is a copy of Puneet Kishor's reply to you from yesterday.

On Oct 3, 2005, at 11:44 AM, Richard wrote:

> Did this:
>
> sqlite3 test2.db
> create Table T (A, B, C );
> .separator ,
> .import 'sqtest2.txt' T
>
> It looks like it working, but the file size is still
> 4K and not 170 Megs.
>
> Please note:
> I exported this database as a Tab delimiter file,
> then as a Comma, delimiter file...
>
> ** Got it to import, however it only imports the first record
> ie:


it is likely that your line endings are Mac (you are on a Mac, iirc).
Open the tab file in a text editor such as BBEdit (or Textwrangler --
free from Barebones) and change the line endings to Unix. Then try again.


>
> sqlite> select * from T;
> -180,90,NaN
> sqlite>
>
> There's a few more hundred thousands.....
> is there suppose to be some kinda of loop statement
> like repeat again..
>
--
Puneet Kishor

As he suggested, you have Mac line endings (single CR) which need to be
changed to unix line endings (single LF) or PC line endings (CR LF
pairs). The shell reads everything up to the first LF as a line (in your
case this is the whole file). It then extracts fields from the line. It
recognizes the CR as the end of a line while extracting fields, but not
when reading the lines. This could be considered a bug since the code
tries to warn you if it finds more fields on the line that it expects.
This check is foiled by the CR detection while extracting fields. When
it goes to get the next line, it hits the end of file and exits.

For now, use your favorite editor to save the csv file in a suitable
format and it should work.

HTH
Dennis Cote