emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Concatenating results
@ 2022-10-03  8:27 Felix Dorner
  2022-10-03  8:45 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Dorner @ 2022-10-03  8:27 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

I have a list of N source blocks, of which each produces a table, and all
these tables have the same column count. What is the easiest way to now
make a single table which is the result of calling all these blocks and
concatenating the result?

Essentially, would be also the same as N CALL together but all append to
the same result instead of a result for each CALL.

Btw thanks, this Org stuff is all so mind blowing.

-- 
Linux. The choice of a GNU generation.

[-- Attachment #2: Type: text/html, Size: 674 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Concatenating results
  2022-10-03  8:27 Concatenating results Felix Dorner
@ 2022-10-03  8:45 ` Ihor Radchenko
  2022-10-03  9:23   ` Felix Dorner
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2022-10-03  8:45 UTC (permalink / raw)
  To: Felix Dorner; +Cc: emacs-orgmode

Felix Dorner <felix.dorner@gmail.com> writes:

> I have a list of N source blocks, of which each produces a table, and all
> these tables have the same column count. What is the easiest way to now
> make a single table which is the result of calling all these blocks and
> concatenating the result?
>
> Essentially, would be also the same as N CALL together but all append to
> the same result instead of a result for each CALL.

There are can be multiple ways to achieve what you want.

One way could be using noweb references:

#+name: block1
#+begin_src emacs-lisp :results table
'((1 2) (3 4))
#+end_src

#+name: block2
#+begin_src emacs-lisp :results table
'((5 6) (7 8))
#+end_src

 
#+begin_src emacs-lisp
(append
'<<block1()>>
'<<block2()>>)
#+end_src


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Concatenating results
  2022-10-03  8:45 ` Ihor Radchenko
@ 2022-10-03  9:23   ` Felix Dorner
  2022-10-03  9:29     ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Dorner @ 2022-10-03  9:23 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

On Mon, Oct 3, 2022 at 10:44 AM Ihor Radchenko <yantar92@gmail.com> wrote:

> #+name: block1
> #+begin_src emacs-lisp :results table
> '((1 2) (3 4))
> #+end_src
>
> #+name: block2
> #+begin_src emacs-lisp :results table
> '((5 6) (7 8))
> #+end_src
>
>
> #+begin_src emacs-lisp
> (append
> '<<block1()>>
> '<<block2()>>)
> #+end_src
>

I get an error with this:
executing Emacs-Lisp code block...
progn: Symbol’s value as variable is void: >>

[-- Attachment #2: Type: text/html, Size: 911 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Concatenating results
  2022-10-03  9:23   ` Felix Dorner
@ 2022-10-03  9:29     ` Ihor Radchenko
  2022-10-04  3:47       ` Felix Dorner
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2022-10-03  9:29 UTC (permalink / raw)
  To: Felix Dorner; +Cc: emacs-orgmode

Felix Dorner <felix.dorner@gmail.com> writes:

> I get an error with this:
> executing Emacs-Lisp code block...
> progn: Symbol’s value as variable is void: >>

That's because noweb references are disabled by default (see
https://orgmode.org/manual/Noweb-Reference-Syntax.html#Noweb-Reference-Syntax)

With default Org settings you need

#+begin_src emacs-lisp :noweb yes
(append
'<<block1()>>
'<<block2()>>)
#+end_src

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Concatenating results
  2022-10-03  9:29     ` Ihor Radchenko
@ 2022-10-04  3:47       ` Felix Dorner
  0 siblings, 0 replies; 5+ messages in thread
From: Felix Dorner @ 2022-10-04  3:47 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

On Mon, Oct 3, 2022 at 11:28 AM Ihor Radchenko <yantar92@gmail.com> wrote:

>
> #+begin_src emacs-lisp :noweb yes
>
> Thank you Ihor.
Felix



-- 
Linux. The choice of a GNU generation.

[-- Attachment #2: Type: text/html, Size: 606 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-04  3:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-03  8:27 Concatenating results Felix Dorner
2022-10-03  8:45 ` Ihor Radchenko
2022-10-03  9:23   ` Felix Dorner
2022-10-03  9:29     ` Ihor Radchenko
2022-10-04  3:47       ` Felix Dorner

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).