RosettaCodeData/Task/Averages-Root-mean-square/AWK/averages-root-mean-square.awk
2023-07-01 13:44:08 -04: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);
}