Browse Source

babel: Allow specification of field separator when reading tables

2010-08-03  Dan Davison  <davison@stats.ox.ac.uk>

	* ob.el (org-babel-import-elisp-from-file):
	Allow separator to be specified
Dan Davison 14 years ago
parent
commit
34144f9a95
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/ob.el

+ 2 - 2
lisp/ob.el

@@ -1508,7 +1508,7 @@ This is taken almost directly from `org-read-prop'."
 	      (length string)))
 	      (length string)))
       (string-to-number string)))
       (string-to-number string)))
 
 
-(defun org-babel-import-elisp-from-file (file-name)
+(defun org-babel-import-elisp-from-file (file-name &optional separator)
   "Read the results located at FILE-NAME into an elisp table.
   "Read the results located at FILE-NAME into an elisp table.
 If the table is trivial, then return it as a scalar."
 If the table is trivial, then return it as a scalar."
   (let (result)
   (let (result)
@@ -1516,7 +1516,7 @@ If the table is trivial, then return it as a scalar."
       (with-temp-buffer
       (with-temp-buffer
 	(condition-case nil
 	(condition-case nil
 	    (progn
 	    (progn
-	      (org-table-import file-name nil)
+	      (org-table-import file-name separator)
 	      (delete-file file-name)
 	      (delete-file file-name)
 	      (setq result (mapcar (lambda (row)
 	      (setq result (mapcar (lambda (row)
 				     (mapcar #'org-babel-string-read row))
 				     (mapcar #'org-babel-string-read row))