2

If I have the following text:

Name Score Bob 87 Ted 99 Mary 78

I know C-c | will covert it to org table. But how can I do the other way around?

If I have a org table already, how can I convert it to text block?

I originally thought I could use multiple-cursor to delete, but this is not that effective if the table is huge.

Anyone any ideas? Thanks

  • 1
    M-%? (query-replace) – JeanPierre Jun 19 '16 at 12:08
  • Related question. Note that org-export-table can convert org tables to several formats, but not in-place. – Juancho Jun 19 '16 at 23:23
  • I found the procedure can also be quick: select a region, M-x replace string, | -> nothing – ted930511 Jun 20 '16 at 7:35
3

Somewhat inspired by org-table-transpose-table-at-point:

(defun org-table-strip-table-at-point ()
  (interactive)
  (let* ((table (delete 'hline (org-table-to-lisp)))
     (contents (orgtbl-to-generic
            table '(:sep "\t"))))
    (goto-char (org-table-begin))
    (re-search-forward "|")
    (backward-char)
    (delete-region (point) (org-table-end))
    (insert contents)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.