emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Computing the value of some cells of a table using a named code


From: Alan Schmitt
Subject: Re: [O] Computing the value of some cells of a table using a named code block
Date: Wed, 02 Apr 2014 15:04:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

Hi Michael,

Michael Brand <address@hidden> writes:

> When there is no named source block involved I use just
>
> | Category | Budget | Spending |
> |----------+--------+----------|
> | Food     |   1000 | Food     |
> | Rent     |   1000 | Rent     |
> #+TBLFM: $3 = '(org-trim (shell-command-to-string (concat "echo " $1)))
>
> For named source blocks there is sbe, see Worg.

This is most useful, thanks a lot!

For the record, here is the solution using org-sbe:

--8<---------------cut here---------------start------------->8---
#+name: spending
#+begin_src sh :var c="bar" :results silent
expr $c
#+end_src

| Category | Budget | Spending |
|----------+--------+----------|
| Food     |   1000 | Food     |
| Rent     |   1000 | Rent     |
#+TBLFM: $3='(org-sbe "spending" (c (concat "\"" $1 "\"")))
--8<---------------cut here---------------end--------------->8---

Thanks again,

Alan



reply via email to

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