Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Averaging rows

Status
Not open for further replies.

KingVodka

Technical User
Joined
Dec 15, 2003
Messages
5
Location
NL
Hi,

I need to reduce a dataset(1000 rows) to approximately 40 or 50 rows by averaging each 20 rows. Any help from the awk forum is appreciated. I have something like this:

0 4
2 6
3 8
4 10
. .
. .
. .
. .
998 15
999 12
1000 13

In the beginning of the data set I would like to average every 2 or 3 rows and the end every 40 or 50 rows. Is there an awk script or command which provide flexibility with this kind of averaging. I have other data set which I also have to reduce. However in those situation I need different averaging (like 10 rows in the beginning and 2 rows at the end).

Thanks,




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top