1

Is there a way to copy the table presented in "column view" as raw text?

3
  • I have not played with column-view using a variation of the code in the following link, but the code "as is" extracts the raw data used to create a standard *Org Agenda* buffer based upon the let-bound settings of the code: emacs.stackexchange.com/a/12563/2287 I have not tried out the code with recent versions of org-mode, but I would imagine the same principle will still work. Perhaps you can adapt that to suit your needs to extract the text that would otherwise go into a column-view. The raw data will contain text-properties (with more data) that can also be extracted.
    – lawlist
    Mar 4, 2020 at 19:02
  • See Capturing column view in the Org mode manual.
    – NickD
    Mar 4, 2020 at 21:49
  • There is also overlaysToText, but its implementation does not seem to be very robust. The output buffer looks a bit different than the input buffer.
    – Tobias
    Mar 5, 2020 at 14:19

1 Answer 1

1

As mentioned in my comment, you should look at the Capturing column view section of the Org manual for additional details, but doing

M-x org-insert-columns-dblock RET global RET

should give you a good beginning.

E.g. given this file:

 TODO foo

foo

* TODO bar
  :LOGBOOK:
  CLOCK: [2020-03-05 Thu 07:44]
  :END:

bar

if you position the cursor at the end of the file and do M-x org-insert-columns-dblock RET global RET you will get this:

* TODO foo

foo

* TODO bar
  :LOGBOOK:
  CLOCK: [2020-03-05 Thu 07:44]
  :END:

bar

#+BEGIN: columnview :hlines 1 :id global
| ITEM | TODO | PRIORITY | TAGS |
|------+------+----------+------|
| foo  | TODO | B        |      |
|------+------+----------+------|
| bar  | TODO | B        |      |
#+END:

If you then change the file (e.g. add another heading), you can update the dynamic block with M-x org-update-dblock or just C-c C-c on the #+BEGIN: line of the block.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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