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: Fri, 17 Jun 2016 07:03:06 -0400
User-agent: mu4e 0.9.16; emacs 25.1.50.1

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

#+RESULTS:
| 3 | 4 | 6 | 7 |

Here is a non-dash solution that works for two lists.

#+BEGIN_SRC emacs-lisp :var c0=tab2[,0] :var c2=tab2[,2]
(loop for a in c0 for b in c2 collect (list a b))
#+END_SRC

#+RESULTS:
| 1 | 3 |
| 2 | 4 |
| 3 | 6 |
| 4 | 7 |


Uwe Brauer writes:

>>>> "John" == John Kitchin <address@hidden> 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 not work for me (I loaded dash)
>
> Here is the backtrace
> I also deleted the "-" in (-zip-with 'list c0 c2) to obtain
> (zip-with 'list c0 c2), but zip-with is not known as a command.


-- 
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]