"Cook, Malcolm" <m...@stowers.org> writes:

> Is there any best approach to formatting output of bash or shell code block 
> as an org table whose first line is a header.

#+name: first-line-as-colnames
#+begin_src emacs-lisp :var table=()
(append (list (car table)) '(hline) (cdr table))
#+end_src


#+begin_src bash :results output table :post 
first-line-as-colnames(table=*this*)
echo "Name,Age"
echo "Alice,30"
echo "Bob,25"
#+end_src

#+RESULTS:
| Name  | Age |
|-------+-----|
| Alice |  30 |
| Bob   |  25 |

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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