The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
how to average in awk
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
how to average in awk
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
06-04-2008
saint2006
Registered User
Join Date: May 2008
Posts: 12
Quote:
Originally Posted by
shamrock
Code:
awk '{ x+=$2 if(!NR%5) { printf("avg of lines %d-%d is %.1f\n", NR-4, NR, x/5) x=0 } }' file
Thank you....let me try the script
saint2006
View Public Profile
Find all posts by saint2006
Find saint2006's past nominations received
Find saint2006's present nominations given