2

Newbie Emacs org question.

Wanted to export my tasks into a CSV reading spreadsheet program. How would one do that? If it is in the manual, could please point me to it?

Sample:

* A
** A1
   CLOCK: [2015-08-01 Sat 19:33]--[2015-08-01 Sat 19:33] =>  0:00
* B
* C
** Ok something about C
   CLOCK: [2015-08-01 Sat 19:35]--[2015-08-01 Sat 19:36] =>  0:01

#+BEGIN: clocktable :maxlevel 2 :scope subtree
#+CAPTION: Clock summary at [2015-08-01 Sat 19:36]
| Headline                   | Time   |      |
|----------------------------+--------+------|
| *Total time*               | *0:01* |      |
|----------------------------+--------+------|
| \emsp Ok something about C |        | 0:01 |
#+END:
  • 2
    An expected sample of CSV output would help us all quite a bit. – PythonNut Aug 3 '15 at 4:18
  • @PythonNu: Apologize for long time no reply. My personal requirement is pretty basic: Date, Time, Hour(s) (in decimal format), is for billing on tasks. Does this make things clearer? – bgs Sep 15 '15 at 20:18
2

Not sure if this is really what you want but I wrote a keyboard macro that will turn a line like this

   CLOCK: [2015-08-01 Sat 19:33]--[2015-08-01 Sat 19:33] =>  0:00

into this

2015-08-01 Sat 19:33,2015-08-01 Sat 19:33,0:00

To use it, eval this

(setq last-kbd-macro
   [?\C-a ?\M-z ?\[ ?\C-s ?\] ?\C-r ?\C-m ?\M-z ?\[ ?, ?\C-s ?\] ?\C-r ?\C-m ?\C-u ?\C-d ?\M-  ?\C-? ?, ?\C-n ?\C-a])

(M-: is the key to eval) and then run the macro with C-x e

Here's a more verbose breakdown of the macro:

C-a         ;; move-beginning-of-line
M-z         ;; zap-to-char
[           ;; self-insert-command
C-s         ;; isearch-forward
]           ;; self-insert-command
C-r         ;; isearch-backward
RET         ;; help-follow
M-z         ;; zap-to-char
[           ;; self-insert-command
,           ;; self-insert-command
C-s         ;; isearch-forward
]           ;; self-insert-command
C-r         ;; isearch-backward
RET         ;; help-follow
C-u C-d         ;; delete-char
M-SPC           ;; just-one-space
DEL         ;; scroll-down-command
,           ;; self-insert-command
C-n         ;; next-line
C-a         ;; move-beginning-of-line

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.