Created
April 19, 2016 07:50
-
-
Save ricrogz/2bc12679b7e881a457aaae216ef6d66e to your computer and use it in GitHub Desktop.
Find the mean, min and max values in a column using 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 '{if(min==""){min=max=$1}; if($1>max) {max=$1}; if($1< min) {min=$1}; total+=$1; count+=1} END {print total/count, min, max}' FILE.DAT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment