With clock reports, one can set :step day
, and then I have a list of totals by day.
Like:
#+BEGIN: clocktable :tstart "<-1w>" :tend "<+1d>" :step day :scope ("dev.org" "tst.org") :maxlevel 1 :narrow 65
| File | Headline | Time |
|-----------+-------------------------------------------------------------------+--------|
| | ALL *Total time* | *6:38* |
|-----------+-------------------------------------------------------------------+--------|
| dev.org | *File time* | *3:04* |
| tst.org | *File time* | *3:34* |
But it's quite verbose, lots of info. I'd like a summary.
I'd like to post-process that list so that I have the total productivity by day, like:
[2015-02-19 Thu] 6:38 (Dev.org 3:00, testing.org 3:20)
[2015-02-20 Fri] 5:03 (Dev.org 3:00, testing.org 2:03)
[2015-02-21 Sat] 4:30 (Dev.org 2:00, testing.org 2:30)
I'm willing to write some code to maybe grep out the relevant bits and glue it all together.
But I'm kinda wondering, how do I go about starting something like this? I.e, what would be the building blocks?
Can I use like the :formatter property with some function? or can I use bable to post-process this with some bash/grep/awk/sed/cut, or with python?
[edit] A bash solution.. So far I've hacked myself something together with bash.
I generate a report as above. Then export it into ascii into report.txt. Then I use a bash script:
cat ~/git/LeoUfimtsev.github.io/org/reports.txt | egrep 'Daily|Total' | tr -d '[[:space:]]' | sed 's/Daily/\nDaily/g' | sed 's/\*Totaltime\*\*/ /g' | sed 's/Dailyreport://g' | sed 's/ALL/ /g' | sed -E -e 's/Thu|Fri|Sat|Sun|Mon|Tue|Wed|\*//g'
And then I get something like this:
37:47
2015-02-19 6:42
2015-02-20 4:02
2015-02-21 0:00
2015-02-22 2:55
2015-02-23 4:09
2015-02-24 4:37
Now I just have to automate things.
- open report.org buffer
- export to ascii
- run bash script
- show output somewhere
- Plot onto chart :-D
I think these are probably straight-forward enough for me to tacke on my own thou. That said, if anyone has any better advice, I'm open to suggestions.