Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I export a comma-separated list of values from a column of an org-mode table

Tags:

emacs

org-mode

I have a table in org-mode with emails in one column. I want to collect all the emails as a comma-separated list, but I don't know an easy way to do it. It seems like something fairly simple, but I can't find a solution anywhere on the web.

What would be the simplest way to do it?

like image 462
Milan Avatar asked Dec 04 '25 09:12

Milan


1 Answers

One manual approach would be to use rectangle editing commands to extract the content of that column (which should be nicely aligned by org-mode), and then just search and replace to convert to CSV format:

  • C-SPC at first corner
  • C-xrk at opposite corner
  • C-/ to undo the kill (there's no default copy-rectangle command)

Then in the buffer where you want the list of addresses:

  • C-xry to yank the rectangle
  • C-xC-x to exchange point and mark, marking the region
  • C-M-% to regex search and replace within the region, like so:

C-M-%SPC*C-qC-jRET,RET!

like image 105
phils Avatar answered Dec 06 '25 06:12

phils