Re: [O] extract a region from a table and export it

2016-06-17 Thread Uwe Brauer
>>> "Rasmus" == Rasmus writes: > Uwe Brauer writes: >> > John Kitchin writes: D> the problem seems to be that c0 and c2 are set to nil for some reason. I >> >> > Or >> >> > #+BEGIN_SRC emacs-lisp :var c0=tab2[,0]

Re: [O] extract a region from a table and export it

2016-06-17 Thread Uwe Brauer
>>> "John" == John Kitchin writes: > Those look like characters somehow to me. What org version are you using? > and what emacs? Me? Emacs 25.1.5 and 8.3.4 Uwe

Re: [O] extract a region from a table and export it

2016-06-17 Thread John Kitchin
Those look like characters somehow to me. What org version are you using? and what emacs? John --- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin

Re: [O] extract a region from a table and export it

2016-06-17 Thread Rasmus
Uwe Brauer writes: >> John Kitchin writes: >D> the problem seems to be that c0 and c2 are set to nil for some reason. I > >> Or > >> #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] >> (cl-mapcar 'list c0 c2) >>

Re: [O] extract a region from a table and export it

2016-06-17 Thread Rasmus
Uwe Brauer writes: >> John Kitchin writes: >D> the problem seems to be that c0 and c2 are set to nil for some reason. I > >> Or > >> #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] >> (cl-mapcar 'list c0 c2) >>

Re: [O] extract a region from a table and export it

2016-06-17 Thread Uwe Brauer
> John Kitchin writes: D> the problem seems to be that c0 and c2 are set to nil for some reason. I > Or > #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] > (cl-mapcar 'list c0 c2) > #+END_SRC Thanks but I obtain #+RESULTS: | 110 | 110 | |

Re: [O] extract a region from a table and export it

2016-06-17 Thread Uwe Brauer
Thanks but none works for me in the following I will show my results #+tblname: tab2 | 1 | a | 3 | | 2 | b | 4 | | 3 | c | 6 | | 4 | d | 7 | #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] c0 #+END_SRC #+RESULTS: : nil I obtain #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var

Re: [O] extract a region from a table and export it

2016-06-17 Thread Rasmus
John Kitchin writes: D> the problem seems to be that c0 and c2 are set to nil for some reason. I > doubt dash has anything to do with it. Try these: > > #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] > c0 > #+END_SRC > > > #+RESULTS: > | 1 | 2 | 3 | 4 | > >

Re: [O] extract a region from a table and export it

2016-06-17 Thread John Kitchin
the problem seems to be that c0 and c2 are set to nil for some reason. I doubt dash has anything to do with it. Try these: #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] c0 #+END_SRC #+RESULTS: | 1 | 2 | 3 | 4 | #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] c2 #+END_SRC

Re: [O] extract a region from a table and export it

2016-06-17 Thread Uwe Brauer
>>> "John" == John Kitchin writes: > (require 'dash) > #+tblname: tab2 > | 1 | a | 3 | > | 2 | b | 4 | > | 3 | c | 6 | > | 4 | d | 7 | > #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] > (-zip-with 'list c0 c2) > #+END_SRC That does

Re: [O] extract a region from a table and export it

2016-06-17 Thread Uwe Brauer
> #+BEGIN_SRC emacs-lisp :var data=example-table[,0] > (mapcar 'list data) > #+END_SRC > #+RESULTS: > | 1 | > | 2 | > | 3 | > | 4 | thanks that worked great!

Re: [O] extract a region from a table and export it

2016-06-16 Thread John Kitchin
(require 'dash) #+tblname: tab2 | 1 | a | 3 | | 2 | b | 4 | | 3 | c | 6 | | 4 | d | 7 | #+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2] (-zip-with 'list c0 c2) #+END_SRC #+RESULTS: | 1 | 3 | | 2 | 4 | | 3 | 6 | | 4 | 7 | Uwe Brauer writes: >> Uwe Brauer writes:

Re: [O] extract a region from a table and export it

2016-06-16 Thread John Kitchin
#+BEGIN_SRC emacs-lisp :var data=example-table[,0] (mapcar 'list data) #+END_SRC #+RESULTS: | 1 | | 2 | | 3 | | 4 | Uwe Brauer writes: >> Uwe Brauer writes: > >> See (info "(org) var") in particular the section on "Indexable variable >> values". > > >>

Re: [O] extract a region from a table and export it

2016-06-16 Thread Uwe Brauer
> Uwe Brauer writes: > See (info "(org) var") in particular the section on "Indexable variable > values". > Additionally, an empty index, or the single character ‘*’, are both > interpreted to mean the entire range and as such are equivalent to

Re: [O] extract a region from a table and export it

2016-06-16 Thread Uwe Brauer
> Uwe Brauer writes: > See (info "(org) var") in particular the section on "Indexable variable > values". > Additionally, an empty index, or the single character ‘*’, > are both > interpreted to mean the entire range and as such are

Re: [O] extract a region from a table and export it

2016-06-14 Thread Rasmus
Uwe Brauer writes: "John" == John Kitchin writes: > > > >> or, rows 0, 1 and 4. > >> #+BEGIN_SRC emacs-lisp :var d=data >> (loop for i in '(0 1 4) collect (elt d i)) >> #+END_SRC > > Ok the second code works now, and is almost what

Re: [O] extract a region from a table and export it

2016-06-14 Thread Uwe Brauer
>>> "John" == John Kitchin writes: > How about: > #+tblname: grades > || H1 | H2 | H3 | Great exactly what I needed, thanks! Maybe such code should be included somewhere, (manual?) Uwe

Re: [O] extract a region from a table and export it

2016-06-14 Thread John Kitchin
How about: #+tblname: grades || H1 | H2 | H3 | |+++| | P1 | 90 | 89 | 91 | | P2 | 67 | 65 | 78 | | P3 | 99 | 98 | 97 | collect row 0 and 2, columns 0 (P) and 2 (H2) #+BEGIN_SRC emacs-lisp :var data=grades (loop for i in '(0 2) with row = nil do (setq row

Re: [O] extract a region from a table and export it

2016-06-14 Thread Uwe Brauer
>>> "John" == John Kitchin writes: Hi John, > can you write a little code block that filters the table for what you > want, and then convert that to a pdf? Great! Thanks a lot. This is a brilliant idea, on a second thought I would even say that I don't need

Re: [O] extract a region from a table and export it

2016-06-14 Thread Uwe Brauer
>>> "John" == John Kitchin writes: > or, rows 0, 1 and 4. > #+BEGIN_SRC emacs-lisp :var d=data > (loop for i in '(0 1 4) collect (elt d i)) > #+END_SRC Ok the second code works now, and is almost what I want, but I need it mostly for columns, it is not

Re: [O] extract a region from a table and export it

2016-06-14 Thread John Kitchin
can you write a little code block that filters the table for what you want, and then convert that to a pdf? Something like: #+tblname: data | 1 | a | | 2 | r | | 5 | 7 | | 4 | 9 | | 8 | y | #+BEGIN_SRC emacs-lisp :var d=data (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< (car x)

Re: [O] extract a region from a table and export it

2016-06-14 Thread Philip Hudson
On 14 June 2016 at 11:44, Uwe Brauer wrote: > Is it possible to extract just say two regions from a huge table and > convert it to say CSV? Yes. Anything you can think of is possible in Emacs. Usually in two or more different ways. :-) Presumably you want to automate this to

[O] extract a region from a table and export it

2016-06-14 Thread Uwe Brauer
Hi Is it possible to extract just say two regions from a huge table and convert it to say CSV? Uwe Brauer