Write an abstract of tasks
This commit is contained in:
parent
2c5c2f41c4
commit
b935a0b3e2
1 changed files with 38 additions and 0 deletions
38
resume.awk
Executable file
38
resume.awk
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/awk -f
|
||||
# number of minutes from str of hh:mm format
|
||||
function minFromTime(str){
|
||||
h=str;
|
||||
m=str;
|
||||
gsub(/:.*$/,"",h);
|
||||
gsub(/^.*:/,"",m);
|
||||
return h*60+m;
|
||||
}
|
||||
# take a number of minutes, return a xh xxm format
|
||||
function timeFromMin(time) {
|
||||
m=time%60;
|
||||
h=(time -m )/60;
|
||||
if (m<10) {
|
||||
m="0"m;
|
||||
}
|
||||
return h"h "m"m";
|
||||
}
|
||||
|
||||
# get the name of the task
|
||||
function message(){
|
||||
msg=$6;
|
||||
for (i=7;i<=NF;i++) {msg=msg" "$i}
|
||||
return msg;
|
||||
}
|
||||
|
||||
# For each line
|
||||
{
|
||||
m=message()
|
||||
time[m]=time[m]+minFromTime($5)-minFromTime($3);
|
||||
}
|
||||
|
||||
# Print the result
|
||||
END {
|
||||
for(i in time) {
|
||||
print i"\t:\t"timeFromMin(time[i]);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue