RosettaCodeData/Task/Averages-Root-mean-square/AWK/averages-root-mean-square.awk
2013-04-10 14:58:50 -07:00

11 lines
167 B
Awk

#!/usr/bin/awk -f
# computes RMS of the 1st column of a data file
{
x = $1; # value of 1st column
S += x*x;
N++;
}
END {
print "RMS: ",sqrt(S/N);
}