emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /h


From: Ihor Radchenko
Subject: Re: [BUG] ":sep" header argument doesn't work in ob-shell [9.6.21 ( @ /home/aragaer/.config/emacs/elpa/org-9.6.21/)]
Date: Tue, 12 Mar 2024 14:38:14 +0000

Ilya Konovalov <aragaer@gmail.com> writes:

> On current master using ":sep" header argument does not work as
> expected and records are always split on whitespaces. For example:
>
> #+begin_src sh :sep "\t"
>   echo hello world
>   echo test
> #+end_src
>
> #+RESULTS:
> | hello | world |
> | test  |       |

It looks like you are trying to achieve precise control over how
ob-shell interprets the evaluation result.

Note that you can always force :results scalar to interpret the output
as string. Otherwise, Org mode tries to guess the output format.

Since bash does not have a notion of table output, Org's guess is
arbitrary - split multiline result string by line assuming whitespace as
field separator.

So, this is not a bug.
Canceled.

To parse the result as table using custom rules, you can use :post
header argument + custom src block that parser the output string as you
need.

We might consider making ob-shell output handling smarter, as a feature
request.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]