emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Olaf Dietsche <olaf+list.orgmode@olafdietsche.de>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: Date-centric Clocktable
Date: Wed, 07 Sep 2011 11:01:22 +0200	[thread overview]
Message-ID: <87mxegenfh.fsf@rat.lan> (raw)
In-Reply-To: <87zkip7oc6.fsf@gmail.com> (rasmus@gmx.us's message of "Wed, 31 Aug 2011 14:33:13 +0200")

Rasmus <rasmus@gmx.us> writes:

> Is is possible to have a clocktabke with times in the left-most column?
> The people I am doing some work for now prefer it that way for unknown
> reasons. 
>
> This is an example
>
> | date                                           | Headline        | total |
> |------------------------------------------------+-----------------+-------|
> | [2011-08-19 Fri 00:28]--[2011-08-19 Fri 00:51] | Writing mails   |  0:23 |
> | [2011-06-22 Wed 17:00]--[2011-06-22 Wed 17:45] | Data processing |  0:45 |

Why don't you just use a simple (perl/python/...) script to collect your
data? Here's a quick hack in perl:

---8<--- cut here ---
#! /usr/bin/perl -n

use strict;
use warnings;

our $headline;

BEGIN {
print "| date                                           | Headline        | total |\n";
print "|------------------------------------------------+-----------------+-------|\n";
}

# save current headline
$headline = $1 if (m/^\s*\*+\s+(.+)/);

# dump clock line
if (m/^\s*CLOCK:\s+(.+?)\s+=>\s+(.+)/) {
	print "| $1 | $headline | $2 |\n";
}
--- cut here --->8---

Run the script as

$ perl -n collect-timestamps.pl /path/to/org/*.org >clocktable.txt

You must tweak the formatting and make it more robust, but you get the
idea. If you prefer python, there are some python libraries listed at
<http://orgmode.org/worg/org-tools/index.html>.

Regards, Olaf

  parent reply	other threads:[~2011-09-07  9:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31 12:33 Date-centric Clocktable Rasmus
2011-09-06 10:36 ` Bernt Hansen
2011-09-06 21:36   ` Rasmus
2011-09-06 21:47     ` Carsten Dominik
2011-09-07  8:07       ` Rasmus
2011-09-07  8:16         ` Carsten Dominik
2011-09-07 12:54           ` Giovanni Ridolfi
2011-09-07  2:08     ` Bernt Hansen
2011-09-07  8:11       ` Rasmus
2011-09-07  9:01 ` Olaf Dietsche [this message]
2011-09-07  9:09   ` Rasmus
2011-09-07 10:16     ` Olaf Dietsche
2011-09-07 10:28       ` Carsten Dominik
2011-09-07 13:54         ` Olaf Dietsche
2011-09-07 22:53           ` Rasmus
2011-09-08 13:40             ` A. Ryan Reynolds
2011-09-07 10:56       ` Rasmus
2011-09-07 11:30         ` Olaf Dietsche
2011-09-07 13:38       ` Olaf Dietsche
2011-09-07 23:38         ` Rasmus
2011-10-21 17:52 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxegenfh.fsf@rat.lan \
    --to=olaf+list.orgmode@olafdietsche.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).