From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: How to pass table to SRC block as strings only? Date: Thu, 19 Jan 2017 09:07:29 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="0-1717596044-1484845649=:745" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUGBT-00010Q-87 for emacs-orgmode@gnu.org; Thu, 19 Jan 2017 12:07:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUGBP-0000CL-N7 for emacs-orgmode@gnu.org; Thu, 19 Jan 2017 12:07:35 -0500 Received: from iport-bcv2-out.ucsd.edu ([132.239.0.73]:4164) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1cUGBP-0000BC-4c for emacs-orgmode@gnu.org; Thu, 19 Jan 2017 12:07:31 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: =?ISO-8859-15?Q?S=E9bastien_Brisard?= Cc: emacs-orgmode@gnu.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1717596044-1484845649=:745 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 19 Jan 2017, Sébastien Brisard wrote: > 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. Actually, it is not a float: #+BEGIN_SRC emacs-lisp :var table=table20170119 :colnames yes :results pp (number-to-string (nth 1 (car table))) #+END_SRC #+RESULTS: : "1234567890" Maybe this is what you want: #+BEGIN_SRC emacs-lisp :var table=table20170119 :colnames yes :results pp (map 'list (lambda (row) (format "%s" (nth 1 row))) table) #+END_SRC #+RESULTS: : ("1234567890" "a" "b" "c") HTH, Chuck --0-1717596044-1484845649=:745--