emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: Re: extract a region from a table and export it
Date: Tue, 14 Jun 2016 12:13:11 +0000	[thread overview]
Message-ID: <87h9cwvui0.fsf@mat.ucm.es> (raw)
In-Reply-To: m260tc586s.fsf@Johns-MacBook-Air.local

>>> "John" == John Kitchin <jkitchin@andrew.cmu.edu> 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 orgtbl-to-csv, but I just want to
extract 3 columns of a table which contains 10. What would the relevant
syntax be for column, please?

This way I have a poor-man's database (basically I need that for the
grades of my students).

   > 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


I obtain an error when I run your code (but of them, namely)
(but I am using a very recent version of org mode)
,----
| 
| Debugger entered--Lisp error: (wrong-type-argument listp "nil")
|   -filter((lambda (x) (and (> (car x) 2) (< (car x) 8))) "nil")
|   (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< (car x) 8)))
|   d) nil) (let ((d (quote "nil"))) (orgtbl-to-csv (-filter (lambda (x)
|   (and (> (car x) 2) (< (car x) 8))) d) nil)) (progn (let ((d (quote
|   "nil"))) (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (<
|   (car x) 8))) d) nil))) eval((progn (let ((d (quote "nil")))
|   (orgtbl-to-csv (-filter (lambda (x) (and (> (car x) 2) (< (car x) 8)))
|   d) nil)))) org-babel-execute:emacs-lisp("(orgtbl-to-csv (-filter
|   (lambda (x) (and (> (car x) 2) (< (car x) 8))) d) nil)" ((:comments .
|   "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no")
|   (:tangle . "no") (:exports . "code") (:results . "replace") (:var d .
|   "nil") (:session . "none") (:hlines . "no") (:result-type . value)
|   (:result-params "replace") (:rowname-names) (:colname-names)))
|   org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe()
|   org-babel-execute-maybe() org-babel-execute-safely-maybe()
|   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
|   org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil)
|   call-interactively(org-ctrl-c-ctrl-c nil nil)
|   command-execute(org-ctrl-c-ctrl-c)
`----


What could the problem?

Thanks again!

Uwe 

  reply	other threads:[~2016-06-14 12:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 10:44 extract a region from a table and export it Uwe Brauer
2016-06-14 11:14 ` Philip Hudson
2016-06-14 11:19 ` John Kitchin
2016-06-14 12:13   ` Uwe Brauer [this message]
2016-06-14 12:17   ` Uwe Brauer
2016-06-14 12:42     ` John Kitchin
2016-06-14 13:10       ` Uwe Brauer
2016-06-14 16:12     ` Rasmus
2016-06-16 16:12       ` Uwe Brauer
2016-06-16 17:18         ` John Kitchin
2016-06-17  8:59           ` Uwe Brauer
2016-06-16 16:16       ` Uwe Brauer
2016-06-16 17:23         ` John Kitchin
2016-06-17  9:01           ` Uwe Brauer
2016-06-17 11:03             ` John Kitchin
2016-06-17 11:34               ` Rasmus
2016-06-17 13:08                 ` Uwe Brauer
2016-06-17 13:42                   ` Rasmus
2016-06-17 13:42                   ` Rasmus
2016-06-17 17:26                     ` Uwe Brauer
2016-06-17 13:47                   ` John Kitchin
2016-06-17 17:25                     ` Uwe Brauer
2016-06-17 13:07               ` Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9cwvui0.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).