emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to pass table to SRC block as strings only?
@ 2017-01-19  6:55 Sébastien Brisard
  2017-01-19 17:07 ` Charles C. Berry
  0 siblings, 1 reply; 6+ messages in thread
From: Sébastien Brisard @ 2017-01-19  6:55 UTC (permalink / raw)
  To: emacs-orgmode

Hello all,
here is a MWE

=====BEGIN MWE=====

#+NAME: table20170119
| col1 | col2       |
|------+------------|
| row1 | 1234567890 |
| row2 | a          |
| row3 | b          |
| row4 | c          |

#+BEGIN_SRC emacs-lisp :var table=table20170119 :colnames yes :results output
  (print (map 'list (lambda (row) (nth 1 row)) table))
#+END_SRC

#+RESULTS:
:
: (1234567890.0 "a" "b" "c")

=====END MWE=====

As you can see, col #1, row #1 is parsed as a float. I would like it
to be parsed as a string. In other words, the expected RESULTS are

=====BEGIN EXPECTED RESULT=====

#+RESULTS:
:
: ("1234567890" "a" "b" "c")

=====END EXPECTED RESULT=====

Is there an option to prevent org from interpreting the cell values? I
noticed that org-table-to-lisp returns all cells as strings. That's
the functionality I am looking for, in header arguments.

Thanks for your help,
Sébastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-21  5:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19  6:55 How to pass table to SRC block as strings only? Sébastien Brisard
2017-01-19 17:07 ` Charles C. Berry
2017-01-20  2:34   ` Sébastien Brisard
2017-01-20  3:49     ` Charles C. Berry
2017-01-21  5:30       ` Sébastien Brisard
2017-01-21  5:46         ` Sébastien Brisard

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).