When I execute a code block in org mode, the output will be tabularized. I want to use this functionality to build a set of commands which I can then execute in a new code block, so I have to remove all pipe characters first. Is there a way to avoid this?
We should set an output handling options in header arguments.
We need output type
scalar, verbatim The results should be interpreted literally—they will not be converted into a table. The results will be inserted into the Org mode buffer as quoted text. E.g., :results value verbatim.
and output format
raw The results are interpreted as raw Org mode code and are inserted directly into the buffer. If the results look like a table they will be aligned as such by Org mode. E.g., :results value raw.
Tabular interpretation is enabled by default (with implicit header args):
#+BEGIN_SRC emacs-lisp (number-sequence 1 5) #+END_SRC #+RESULTS: | 1 | 2 | 3 | 4 | 5 |
To get raw output we need to change :results header argument to verbatim raw:
#+BEGIN_SRC emacs-lisp :results verbatim raw (number-sequence 1 5) #+END_SRC #+RESULTS: (1 2 3 4 5)
or define that for whole header (or any level):
* Raw output :PROPERTIES: :header-args: :results verbatim raw :END: #+begin_src sh cat <<EOF | 1 | 2 |-- | a | b EOF #+end_src #+RESULTS: | 1 | 2 | |---+---| | a | b |