Daniel Hornung <daniel.horn...@ds.mpg.de> writes: > I think one great way to increase the usefulness of org-mode would be a > function which turns a table into a csv or tsv block of text again. > > I assume that the functionality exists already in org-table-export, I > would just wish for this to be exposed as a function which converts the > table in place instead of writing it into a new file (org-table-export > does not allow overwriting the current file). > > This would finally give a comfortable way to edit tsv or csv tables > without hassles in emacs.
Would you need something more sophisticated than this? #+TBLNAME: tbl | header 1 | header 2 | header 3 | |----------+----------+----------| | label1 | 3 | 99 | | label2 | 2 | 66 | | label3 | 7 | 231 | #+TBLFM: $3=$2*33 #+HEADER: :var table=tbl :hlines no #+HEADER: :results list verbatim #+begin_src emacs-lisp (defun tbl2csv (table-as-lisp) (mapconcat (lambda (row) (mapconcat (lambda (cell) (format "%s" cell)) row ",")) table-as-lisp ",")) (tbl2csv table) #+end_src #+results: : "header 1,header 2,header 3,label1,3,99,label2,2,66,label3,7,231" -- cheers, Thorsten