Search code examples
emacsorg-mode

How to select a column of a table in emacs org mode


I can't find my way around copying a column, or a series of them, from a table.

The only solution I found so far is to copy the whole table and then delete the columns I don't need.

I suppose there must be another easier way for this. Maybe I am just too tired to realize how to do it.


Solution

  • I think the easiest way would be to take advantage of emacs rectangles

    1. To create your rectangle, put your cursor at one of the corners of the rectangle you want to create.

    2. Use C-SPC, or whatever you have set-mark-command set to.

    3. Place your cursor at the diagonal corner of your rectangle.

    4. Use C-x r rr to copy the rectangle to the register named r

    5. Use C-x r ir to insert the rectangle that is being held in the register named r.

    Following this process will copy and insert the columns that you want. You may need to repeat this process if the columns are not adjacent.

    NOTE

    I am using a bolded r to denote that this is technically a name of the register, and not some special input.