From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jude DaShiell Subject: Re: join two or more tables Date: Sun, 18 Aug 2019 07:00:45 -0400 Message-ID: References: <871rxirifk.fsf@mat.ucm.es> <87tvaeq3hz.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36596) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzIvX-00041o-Db for emacs-orgmode@gnu.org; Sun, 18 Aug 2019 07:00:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzIvW-0006V0-1d for emacs-orgmode@gnu.org; Sun, 18 Aug 2019 07:00:47 -0400 Received: from mailbackend.panix.com ([166.84.1.89]:62620) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzIvV-0006UU-UU for emacs-orgmode@gnu.org; Sun, 18 Aug 2019 07:00:45 -0400 In-Reply-To: <87tvaeq3hz.fsf@mat.ucm.es> Content-ID: 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 , emacs-orgmode@gnu.org In that situation I made 3 files header; t1, and t2. The header file had the two lines at the top of both tables. The t1 and t2 files had only record lines in them without the footer. Then cat header t1 t2 >newtable. Once done open newtable and be sure it works in emacs and append that footer line to it and perhaps put it into a #Begin-src #End-src block. On Sun, 18 Aug 2019, Uwe Brauer wrote: > Date: Sun, 18 Aug 2019 04:31:04 > From: Uwe Brauer > To: emacs-orgmode@gnu.org > Subject: Re: [O] join two or more tables > > >>> "UB" == Uwe Brauer writes: > > > Hi > > > I was googling this a bit, I found more complicated scenarios, but not > > how to join one or more tables. > > > For example > > > #+begin_src > > > #+tblname: nut > > | type | Fiber | Sugar | Protein | Carb | > > |----------+-------+-------+---------+------| > > | eggplant | 2.5 | 3.2 | 0.8 | 8.6 | > > | tomatoe | 0.6 | 2.1 | 0.8 | 3.4 | > > | onion | 1.3 | 4.4 | 1.3 | 9.0 | > > | egg | 0 | 18.3 | 31.9 | 18.3 | > > > > #+tblname: nut2 > > | type | Fiber | Sugar | Protein | Carb | > > |----------+-------+-------+---------+------| > > | rice | 0.2 | 0 | 1.5 | 16.0 | > > | bread | 0.7 | 0.7 | 3.3 | 16.0 | > > | orange | 3.1 | 11.9 | 1.3 | 17.6 | > > | banana | 2.1 | 9.9 | 0.9 | 18.5 | > > | tofu | 0.7 | 0.5 | 6.6 | 1.4 | > > | nut | 2.6 | 1.3 | 4.9 | 7.2 | > > | corn | 4.7 | 1.8 | 2.8 | 21.3 | > > #+end_src > > > > I want to generate a new table total-nuts, which is just a combination > > of the two tables, nuts and nuts2 > > > > Uwe Brauer > > I found a solution posted in > > https://lists.gnu.org/archive/html/emacs-orgmode/2009-09/msg00919.html > > However > > ** Elisp > #+tblname: tab1 > | 1 | 2 | 3 | > | 7 | 8 | 9 | > > #+tblname: tab2 > | 4 | 5 | 6 | > | 10 | 11 | 12 | > > Here's a solution in emacs lisp: > > #+srcname: column-bind-elisp(a=tab1, b=tab2) > #+begin_src emacs-lisp > (mapcar* 'append a b) > #+end_src > > > column-bind-elisp > > Does not exist any more. > > Any ideas? > > Uwe Brauer > --