emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: Creating hline in table from source block?
Date: Tue, 26 Nov 2013 21:07:39 +0100	[thread overview]
Message-ID: <87siuj0vw4.fsf@Rainer.invalid> (raw)
In-Reply-To: 87zjormect.fsf@hornfels.zedat.fu-berlin.de

Loris Bennett writes:
> No, the column names are fixed, so that's perfect, thank you.  I
> suspected there might be some more straight-forward way than the
> interesting, but slightly more involved methods suggested by Achim and
> Rasmus.

There might be way to do that, but it's not implemented for shell blocks
since there isn't an easy way to deal with arrays in a shell.  You'd be
much better off using a language that has support for that (like Perl).

In your case (when the first line is always a header and you don't need
hlines anywhere else), the following trick using the end header
arguments of a call line works just as well:

--8<---------------cut here---------------start------------->8---
#+NAME: table
#+BEGIN_SRC sh :results table
echo "a b c d"
echo "1 2 3 4"
echo "5 6 7 8"
#+END_SRC

#+CALL: table() :results table :colnames yes

#+RESULTS:
| a | b | c | d |
|---+---+---+---|
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
--8<---------------cut here---------------end--------------->8---


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

      reply	other threads:[~2013-11-26 20:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 10:52 Creating hline in table from source block? Loris Bennett
2013-11-25 20:13 ` Achim Gratz
2013-11-25 20:43   ` Achim Gratz
2013-11-26 16:40     ` Daniel E. Doherty
2013-11-25 21:38 ` Rasmus
2013-11-26  0:47   ` Rasmus
2013-11-26  2:41 ` Eric Schulte
2013-11-26  8:05   ` Loris Bennett
2013-11-26  8:54     ` Rasmus
2013-11-26 13:14     ` Eric Schulte
2013-11-26 14:23       ` Loris Bennett
2013-11-26 20:07         ` Achim Gratz [this message]

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=87siuj0vw4.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --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).