Re: [O] sqlite im-/export

2013-05-18 Thread Eric Schulte
Oliver Večerník writes: >> I may have missed you spelling this out in a previous email, but can you >> not import Org tables directly into sqlite code blocks? >> >> Evaluate this again after evaluating the second block. >> #+BEGIN_SRC sqlite :csv :db test.sqlite >> SELECT * from t1; >> #+END_SR

Re: [O] sqlite im-/export

2013-05-17 Thread Oliver Večerník
> I may have missed you spelling this out in a previous email, but can you > not import Org tables directly into sqlite code blocks? > > Evaluate this again after evaluating the second block. > #+BEGIN_SRC sqlite :csv :db test.sqlite > SELECT * from t1; > #+END_SRC This works like a charm, thank

Re: [O] sqlite im-/export

2013-05-17 Thread Eric Schulte
Oliver Večerník writes: >> 2. use ":results drawer", and explicitly formatting the results in >>Org-mode syntax w/awk > > Unfortunately this doesn't work. The output is always printed to the > "#+RESULTS:" section and not piped through awk. But working with > ":results raw" works perfect fo

Re: [O] sqlite im-/export

2013-05-16 Thread Oliver Večerník
> 2. use ":results drawer", and explicitly formatting the results in >Org-mode syntax w/awk Unfortunately this doesn't work. The output is always printed to the "#+RESULTS:" section and not piped through awk. But working with ":results raw" works perfect for me. I can even produce a separat

Re: [O] sqlite im-/export

2013-05-16 Thread Oliver Večerník
Eric Schulte writes: > In that case I'd suggest either > > 1. adding :separator support to ob-sh.el, so that you can specify a >different results separator to be passed to >`org-babel-import-elisp-from-file' > > or > > 2. use ":results drawer", and explicitly formatting the results in >

Re: [O] sqlite im-/export

2013-05-16 Thread Eric Schulte
Oliver Večerník writes: > Eric Schulte writes: >> What about >> >> #+BEGIN_SRC sqlite :csv :db test.sqlite >> SELECT * from t1; >> #+END_SRC >> >> #+RESULTS: >> | 1 | apple pie | >> | 2 | sugar | > > I needed some calculations and format tweaking with awk which I piped > the results. That

Re: [O] sqlite im-/export

2013-05-16 Thread Oliver Večerník
Eric Schulte writes: > What about > > #+BEGIN_SRC sqlite :csv :db test.sqlite > SELECT * from t1; > #+END_SRC > > #+RESULTS: > | 1 | apple pie | > | 2 | sugar | I needed some calculations and format tweaking with awk which I piped the results. That is why I choose the shell. In this case

Re: [O] sqlite im-/export

2013-05-16 Thread Eric Schulte
Oliver Večerník writes: > Hi, > > I've got a small test case which I believe is a bug: > > $ cat t1.sql > PRAGMA foreign_keys=OFF; > BEGIN TRANSACTION; > CREATE TABLE t1(id integer,product text); > INSERT INTO "t1" VALUES(1,'apple pie'); > INSERT INTO "t1" VALUES(2,'sugar'); > COMMIT; > sqlite3 t

[O] sqlite im-/export

2013-05-16 Thread Oliver Večerník
Hi, I've got a small test case which I believe is a bug: $ cat t1.sql PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE t1(id integer,product text); INSERT INTO "t1" VALUES(1,'apple pie'); INSERT INTO "t1" VALUES(2,'sugar'); COMMIT; sqlite3 test.sqlite < t1.sql #+BEGIN_SRC sh echo "ID|pro