From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: extract a region from a table and export it Date: Tue, 14 Jun 2016 08:42:23 -0400 Message-ID: References: <87oa74vyma.fsf@mat.ucm.es> <87d1nkvuat.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCnft-0000xk-Bc for emacs-orgmode@gnu.org; Tue, 14 Jun 2016 08:42:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCnfo-0000pM-CY for emacs-orgmode@gnu.org; Tue, 14 Jun 2016 08:42:33 -0400 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:36127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCnfo-0000p5-7y for emacs-orgmode@gnu.org; Tue, 14 Jun 2016 08:42:28 -0400 Received: by mail-qg0-x232.google.com with SMTP id v76so51955797qgv.3 for ; Tue, 14 Jun 2016 05:42:27 -0700 (PDT) In-reply-to: <87d1nkvuat.fsf@mat.ucm.es> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Uwe Brauer Cc: emacs-orgmode@gnu.org 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 (nth i data)) collect (list (nth 0 row) (nth 2 row))) #+END_SRC #+RESULTS: | P1 | 89 | | P3 | 98 | 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 I want, but I need it > mostly for columns, it is not obvious for me that corresponds in the > syntax above to columns. > > > > #+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