Is there a way to copy the table presented in "column view" as raw text?
Asked
Active
Viewed 605 times
1
-
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: https://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 04 '20 at 19:02
-
See [Capturing column view](https://orgmode.org/manual/Capturing-column-view.html#Capturing-column-view) in the Org mode manual. – NickD Mar 04 '20 at 21:49
-
There is also [overlaysToText](https://www.emacswiki.org/emacs/OverlaysToText), but its implementation does not seem to be very robust. The output buffer looks a bit different than the input buffer. – Tobias Mar 05 '20 at 14:19
1 Answers
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.

NickD
- 27,023
- 3
- 23
- 42