emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Brad Knotwell <bknotwell@yahoo.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: combining a source code block and TBLFM
Date: Mon, 25 Jun 2018 16:41:29 +0000 (UTC)	[thread overview]
Message-ID: <1184136243.2122892.1529944889342@mail.yahoo.com> (raw)
In-Reply-To: 1184136243.2122892.1529944889342.ref@mail.yahoo.com

[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]

Good day all--
Beyond outputting raw orgmode text, is there a way to do the following:
* take the table output of a source block* apply a TBLFM operation on it
I have a contrived example below:
#+name: x| a | 3 | 4 |  5 || b | 6 | 8 | 10 |
#+begin_src python :var x=x :results value tablex[0].append('')x[1].append('')x.insert(0,['Item','x','y','z','Total'])x.insert(1,None)x.append(None)x.append(['Total','','','',''])x.append(None)x.insert(0,None)return x#+end_src
#+RESULTS:|-------+---+---+----+-------|| Item  | x | y |  z | Total ||-------+---+---+----+-------|| a     | 3 | 4 |  5 |       || b     | 6 | 8 | 10 |       ||-------+---+---+----+-------|| Total |   |   |    |       ||-------+---+---+----+-------|
I would like the following formula to be applied:

#+TBLFM: @>$2=vsum(@2$2..@-1$2)::@>$3=vsum(@2$3..@-1$3)::@>$4=vsum(@2$4..@-1$4)::$5=$2+$3+$4
but I can't figure out how to keep the evaluation from overwriting the #+TBLFM: line.  While I realize I could just sum everything up in the python code (preferred) or return raw org-mode data (ugly), it occurred to me that there might be an elegant way to do this.
Thx.
--Brad


Thx.
--Brad

[-- Attachment #2: Type: text/html, Size: 2156 bytes --]

           reply	other threads:[~2018-06-25 16:41 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1184136243.2122892.1529944889342.ref@mail.yahoo.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1184136243.2122892.1529944889342@mail.yahoo.com \
    --to=bknotwell@yahoo.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).