>>> "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]
>>> "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
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
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)
>>
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)
>>
> 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 |
|
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
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 |
>
>
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
>>> "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
> #+BEGIN_SRC emacs-lisp :var data=example-table[,0]
> (mapcar 'list data)
> #+END_SRC
> #+RESULTS:
> | 1 |
> | 2 |
> | 3 |
> | 4 |
thanks that worked great!
(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:
#+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".
>
>
>>
> 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
> 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
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
>>> "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
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
>>> "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
>>> "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
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)
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
Hi
Is it possible to extract just say two regions from a huge table and
convert it to say CSV?
Uwe Brauer
23 matches
Mail list logo