Re: [sqlite] Doing fine with SQLite

2010-05-04 Thread Matt Young
All working.  R had sufficient piping to files and allowed me to get it.

On 5/4/10, Gabor Grothendieck  wrote:
> You don't need to dump the data to a csv file and then read it into R
> and there is no need to use the sqlite3 console at all as R's RSQLite
> package can directly read and write SQLite databases.  Also see the
> sqldf package.
>
> On Tue, May 4, 2010 at 1:02 PM, Matt Young  wrote:
>> I can work SQLite from by R stat package, but I am having hard time
>> mixing special sqlite command intermixed with SQL statements when I
>> send a text sequence to swqlite (even from the dos consol)
>>
>>
>> sqlite3 test.db ".mode csv   select * from selected limit 4"
>>
>> Makes sqlite choke because I do not know what the inline terminator is
>> for a  text invocation argument, and can't find it in the docs.
>>
>> That is my last minor detail, and I have indices, joins, and unions
>> going on the Bureau of Labor Statistic under R.  Will make SQLite
>> quite popular among the economists.  Getting access to reams of data
>> from economic we sites, directly into R dataframes via a set of common
>> key words familiar to economists.
>> ___
>> 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
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Doing fine with SQLite

2010-05-04 Thread Gabor Grothendieck
You don't need to dump the data to a csv file and then read it into R
and there is no need to use the sqlite3 console at all as R's RSQLite
package can directly read and write SQLite databases.  Also see the
sqldf package.

On Tue, May 4, 2010 at 1:02 PM, Matt Young  wrote:
> I can work SQLite from by R stat package, but I am having hard time
> mixing special sqlite command intermixed with SQL statements when I
> send a text sequence to swqlite (even from the dos consol)
>
>
> sqlite3 test.db ".mode csv   select * from selected limit 4"
>
> Makes sqlite choke because I do not know what the inline terminator is
> for a  text invocation argument, and can't find it in the docs.
>
> That is my last minor detail, and I have indices, joins, and unions
> going on the Bureau of Labor Statistic under R.  Will make SQLite
> quite popular among the economists.  Getting access to reams of data
> from economic we sites, directly into R dataframes via a set of common
> key words familiar to economists.
> ___
> 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


Re: [sqlite] Doing fine with SQLite

2010-05-04 Thread Pavel Ivanov
>  You can't put dot-commands on the command line.  Try:

I think you can with something like this (assuming your shell is bash):

echo $'.mode csv\nselect * from selected limit 4' | sqlite3 test.db


Pavel

On Tue, May 4, 2010 at 1:11 PM, Jay A. Kreibich  wrote:
> On Tue, May 04, 2010 at 10:02:06AM -0700, Matt Young scratched on the wall:
>
>> sqlite3 test.db ".mode csv   select * from selected limit 4"
>>
>> Makes sqlite choke because I do not know what the inline terminator is
>> for a  text invocation argument,
>
>  You can't put dot-commands on the command line.  Try:
>
>  $ sqlite3 -csv test.db "select * from selected limit 4"
>
>> and can't find it in the docs.
>
>  $ sqlite3 --help
>
>
>   -j
>
> --
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Our opponent is an alien starship packed with atomic bombs.  We have
>  a protractor."   "I'll go home and see if I can scrounge up a ruler
>  and a piece of string."  --from Anathem by Neal Stephenson
> ___
> 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


Re: [sqlite] Doing fine with SQLite

2010-05-04 Thread Black, Michael (IS)
echo .mode csv >input.sql
echo select * from selected limit 4 >>input.sql
 
sqlite3 test.db 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


Re: [sqlite] Doing fine with SQLite

2010-05-04 Thread Jay A. Kreibich
On Tue, May 04, 2010 at 10:02:06AM -0700, Matt Young scratched on the wall:

> sqlite3 test.db ".mode csv   select * from selected limit 4"
> 
> Makes sqlite choke because I do not know what the inline terminator is
> for a  text invocation argument, 

  You can't put dot-commands on the command line.  Try:

  $ sqlite3 -csv test.db "select * from selected limit 4"

> and can't find it in the docs.

  $ sqlite3 --help


   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Doing fine with SQLite

2010-05-04 Thread Matt Young
I can work SQLite from by R stat package, but I am having hard time
mixing special sqlite command intermixed with SQL statements when I
send a text sequence to swqlite (even from the dos consol)


sqlite3 test.db ".mode csv   select * from selected limit 4"

Makes sqlite choke because I do not know what the inline terminator is
for a  text invocation argument, and can't find it in the docs.

That is my last minor detail, and I have indices, joins, and unions
going on the Bureau of Labor Statistic under R.  Will make SQLite
quite popular among the economists.  Getting access to reams of data
from economic we sites, directly into R dataframes via a set of common
key words familiar to economists.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users