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