Sum up a column of text

Linux, awk

awk '{ x += $5 } END { print "total:" x}'

This will add up all of the values in the fifth column.

Comments powered by Disqus

Copyright 2010. All Rights Reserved.