Created
November 26, 2013 16:21
-
-
Save doi-t/7661278 to your computer and use it in GitHub Desktop.
awkで合計、回数、最大、最小、平均を算出する
This file contains 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
awk 'BEGIN{ OFS="\t"; sum=0; max=0; } | |
NR==1 { min=$2; } | |
{ sum+=$2; if($2>max){max=$2}; if(min>$2){min=$2}; } | |
END{ print($1, sum, NR, max, min, sum/NR) }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment