Re: [O] sqlite im-/export

2013-05-18 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, thanks

Re: [O] sqlite im-/export

2013-05-18 Thread Eric Schulte
Oliver Večerník o...@vecernik.at 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;

Re: [O] sqlite im-/export

2013-05-17 Thread Eric Schulte
Oliver Večerník o...@vecernik.at 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

[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|product

Re: [O] sqlite im-/export

2013-05-16 Thread Eric Schulte
Oliver Večerník o...@vecernik.at 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

Re: [O] sqlite im-/export

2013-05-16 Thread Oliver Večerník
Eric Schulte schulte.e...@gmail.com 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.

Re: [O] sqlite im-/export

2013-05-16 Thread Eric Schulte
Oliver Večerník o...@vecernik.at writes: Eric Schulte schulte.e...@gmail.com 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

Re: [O] sqlite im-/export

2013-05-16 Thread Oliver Večerník
Eric Schulte schulte.e...@gmail.com 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

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 separator line