Last active
June 29, 2016 01:48
-
-
Save akanehara/2804468251c6d8a00337be48cf5e3116 to your computer and use it in GitHub Desktop.
Redmine作業時間ユーティリティ(OS X | BSD)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nkf timelog.csv | awk -v Date="2016/05/23" -F',' 'BEGIN{OFS="\t"}$2==Date{print$1,$4,$5,$6;d=$2;h+=$7;l++}END{;print l" Rows";print h"[h]",h/8"[day/man]";print d}' | tail -r | tee >(tail -n+4 | pbcopy) | |
pbpaste | sed -E -e $'s/^[\t\s]*//' | awk -F'\t' '$2~/[0-9]{4}\/[0-9]{2}\/[0-9]{2}/' | awk -F'\t' '{k=$2;gsub(/\//,"",k);d[k]=$2;r[k]=r[k]$1"\t"$4"\t"$5"\t"$6"\n";h[k]+=$7;l[k]++}END{OFS="\t";for(k in d){print d[k],h[k]"[h]",h[k]/8"[day/man]",l[k]" Rows";print r[k]}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment