Friday, 10 February 2012

calculate avg of a column


awk '{ s += $1 } END { print "sum: ", s, " average: ", s/NR, " samples: ", NR }' rails_production_log_or_whatever.log

No comments:

Post a Comment