From: "charles snyder" <clsnyder@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Applying a user-defined function to cols in table
Date: Fri, 12 Sep 2008 20:49:23 -0500 [thread overview]
Message-ID: <fa09ca6d0809121849v4ca88751u2dcb370cc968fded@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 943 bytes --]
Hi
I am trying to apply a function to one column in a table and output the
result to another column. The function looks like this:
(defun yahoo (stock_symbol)
(let (url contents fields price-string price)
(setf url "http://finance.yahoo.com/d/quotes.csv?s=")
(str+! url stock_symbol)
(str+! url "&f=sl1d1t1c1ohgv&e=.csv")
(setf contents (http-get url))
(setf fields (split-sequence #\, contents))
(setf price-string (second fields))
(setf price (read-from-string price-string))
price))
This table looks like this:
| ! | stockname | symbol | shares | curr_price |
| 1 | apple | aapl | 800 | |
| 2 | google | goog | 2100 | |
#+TBLFM: $5= yahoo $3
(I'm using org 6.06b, gnu emacs 22.2 on a mac.)
I have tried some other variants without success.
Is this even possible?
Thanks!
--
Charles L. Snyder, MD
Professor of Surgery
www.clsnyder.com
[-- Attachment #1.2: Type: text/html, Size: 1616 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next reply other threads:[~2008-09-13 1:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-13 1:49 charles snyder [this message]
2008-09-13 4:19 ` Applying a user-defined function to cols in table Nick Dokos
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa09ca6d0809121849v4ca88751u2dcb370cc968fded@mail.gmail.com \
--to=clsnyder@gmail.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.