From mboxrd@z Thu Jan 1 00:00:00 1970 From: abonnements Subject: Re: Include results in a table Date: Tue, 28 Oct 2014 11:08:07 +0100 Message-ID: <544F6B07.6080304@thierry-pelle.eu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------070401010106000302050307" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xj3hY-0002Rd-Po for emacs-orgmode@gnu.org; Tue, 28 Oct 2014 06:08:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xj3hN-0006Rs-UN for emacs-orgmode@gnu.org; Tue, 28 Oct 2014 06:08:32 -0400 Received: from 2.mo6.mail-out.ovh.net ([46.105.76.65]:46140 helo=mo6.mail-out.ovh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xj3hN-0006Rh-LS for emacs-orgmode@gnu.org; Tue, 28 Oct 2014 06:08:21 -0400 Received: from mail179.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo6.mail-out.ovh.net (Postfix) with SMTP id C0314FFADFA for ; Tue, 28 Oct 2014 11:08:20 +0100 (CET) References: 878uk0fsgy.fsf@gmail.com 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------070401010106000302050307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, thank you for your answer. Your solution is OK but only for the example I gave (2 or 3 results). In practice I have about 10 results and the number of them may be variable... Furthermore :vars does not work on my version (I must use :var x=A :var y=B)... Ta. Thierry Hello, >/ I have somethink like that/ > >/ #+call: gen(A)/ >/ #+results: A/ >/ : 10/ > >/ #+call: gen(B)/ >/ #+results: B/ >/ : 20/ > >/ Is there a simple mean to aggregate the results in a table, i.e to get/ >/ | A | 10 |/ >/ | B | 20 |/ > >/ I think some lisp can do that but as a beginner... but as I want to/ >/ learn you can suggest a somewhat complicated solution or a simple idea./ >/ Thanks./ you could define a 3rd block C that takes the results from block A and B as variable via :vars x=A y=B (A and B must be named blocks for this, use a #+NAME: A line) and then do (list A x B y) in block C and use the :results format that outputs a list as a table (often it is the default, otherwise try :results table or so). -- cheers, Thorsten --------------070401010106000302050307 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Hi, thank you for your answer.

Your solution is OK but only for the example I gave (2 or 3 results). In practice I have about 10 results and the number of them may be variable... 
Furthermore :vars does not work on my version (I must use :var x=A :var y=B)...

Ta.
Thierry
 
Hello,

> I have somethink like that
>
> #+call: gen(A)
> #+results: A
> : 10
>
> #+call: gen(B)
> #+results: B
> : 20
>
> Is there a simple mean to aggregate the results in a table, i.e to get
> | A | 10 |
> | B | 20 |
>
> I think some lisp can do that but as a beginner... but as I want to 
> learn you can suggest a somewhat complicated solution or a simple idea.
> Thanks.

you could define a 3rd block C that takes the results from block A and B
as variable via :vars x=A y=B (A and B must be named blocks for this,
use a #+NAME: A line) and then do (list A x B y) in block C and use the
:results format that outputs a list as a table (often it is the default,
otherwise try :results table or so).

-- 
cheers,
Thorsten

--------------070401010106000302050307--