emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: John Kitchin
Subject: Re: [O] extract a region from a table and export it
Date: Tue, 14 Jun 2016 07:19:39 -0400
User-agent: mu4e 0.9.16; emacs 25.1.50.1

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) 8))) d) nil)
#+END_SRC

#+RESULTS:
: 5,7
: 4,9

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

#+RESULTS:
| 1 | a |
| 2 | r |
| 8 | y |




Uwe Brauer writes:

> Hi
>
> Is it possible to extract just say two regions from a huge table and
> convert it to say CSV?
>
> Uwe Brauer


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]