Re: [O] Creating hline in table from source block?

2013-11-26 Thread Achim Gratz
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

Re: [O] Creating hline in table from source block?

2013-11-26 Thread Daniel E. Doherty
And if you are generating this programatically, this works: #+BEGIN_SRC sh :results raw ( echo "|a |b |c |d" echo "|-" echo "|1 |2 |3 |4" echo "|5 |6 |7 |8" ) #+END_SRC -- Daniel E. Doherty

Re: [O] Creating hline in table from source block?

2013-11-26 Thread Loris Bennett
Eric Schulte writes: > "Loris Bennett" writes: > >> Eric Schulte writes: >> >>> "Loris Bennett" writes: >>> Dear List, This #+BEGIN_SRC sh echo "a b c d" echo "1 2 3 4" echo "5 6 7 8" #+END_SRC produces this: #+RESULTS: |

Re: [O] Creating hline in table from source block?

2013-11-26 Thread Eric Schulte
"Loris Bennett" writes: > Eric Schulte writes: > >> "Loris Bennett" writes: >> >>> Dear List, >>> >>> This >>> >>> #+BEGIN_SRC sh >>> echo "a b c d" >>> echo "1 2 3 4" >>> echo "5 6 7 8" >>> #+END_SRC >>> >>> produces this: >>> >>> #+RESULTS: >>> | a | b | c | d | >>> | 1 | 2 | 3 | 4 | >>>

Re: [O] Creating hline in table from source block?

2013-11-26 Thread Rasmus
"Loris Bennett" writes: > So Achim's suggestion of using ":results raw" might be the way to go > (once I've worked out what the sed bit is doing ...) > > However, the table will ultimately be around 4 lines long, > so from a performance point of view it would be nice not to have to pipe > the

Re: [O] Creating hline in table from source block?

2013-11-26 Thread Loris Bennett
Eric Schulte writes: > "Loris Bennett" writes: > >> Dear List, >> >> This >> >> #+BEGIN_SRC sh >> echo "a b c d" >> echo "1 2 3 4" >> echo "5 6 7 8" >> #+END_SRC >> >> produces this: >> >> #+RESULTS: >> | a | b | c | d | >> | 1 | 2 | 3 | 4 | >> | 5 | 6 | 7 | 8 | >> >> How do I get this >>

Re: [O] Creating hline in table from source block?

2013-11-25 Thread Eric Schulte
"Loris Bennett" writes: > Dear List, > > This > > #+BEGIN_SRC sh > echo "a b c d" > echo "1 2 3 4" > echo "5 6 7 8" > #+END_SRC > > produces this: > > #+RESULTS: > | a | b | c | d | > | 1 | 2 | 3 | 4 | > | 5 | 6 | 7 | 8 | > > How do I get this > > #+RESULTS: > | a | b | c | d | > |-+-

Re: [O] Creating hline in table from source block?

2013-11-25 Thread Rasmus
Rasmus writes: > Probably you can remove the require 'cl. Also, you can generalize the > code to take arbitrarily hline positions. Here's a more fun :post function (again depending on cl). #+NAME: add_hline #+BEGIN_SRC emacs-lisp :var data='((a b c) (d e f) (h i j)) h='(0 -2 100 last) (let

Re: [O] Creating hline in table from source block?

2013-11-25 Thread Rasmus
Hi Loris, "Loris Bennett" writes: > How do I get this > > #+RESULTS: > | a | b | c | d | > |-+---+---+---| > | 1 | 2 | 3 | 4 | > | 5 | 6 | 7 | 8 | You might find use of the post header argument here, http://orgmode.org/manual/post.html In this case it's as simple as this #+NAME

Re: [O] Creating hline in table from source block?

2013-11-25 Thread Achim Gratz
Achim Gratz writes: […] Looking at this again, of course this simpler version would do the same. --8<---cut here---start->8--- #+BEGIN_SRC sh :results raw ( echo "a b c d" echo "" echo "1 2 3 4" echo "5 6 7 8" ) | sed -re 's/^| /|/g' -e 's/^\|$/|-/' #+END_SRC -

Re: [O] Creating hline in table from source block?

2013-11-25 Thread Achim Gratz
Loris Bennett writes: > How do I get this > > #+RESULTS: > | a | b | c | d | > |-+---+---+---| > | 1 | 2 | 3 | 4 | > | 5 | 6 | 7 | 8 | You really don't want to use a shell for that, but if you insist, this would do it: --8<---cut here---start->8--- #+

[O] Creating hline in table from source block?

2013-11-25 Thread Loris Bennett
Dear List, This #+BEGIN_SRC sh echo "a b c d" echo "1 2 3 4" echo "5 6 7 8" #+END_SRC produces this: #+RESULTS: | a | b | c | d | | 1 | 2 | 3 | 4 | | 5 | 6 | 7 | 8 | How do I get this #+RESULTS: | a | b | c | d | |-+---+---+---| | 1 | 2 | 3 | 4 | | 5 | 6 | 7 | 8 | ? Thanks,