I have no idea how to even get started with this script.
I need to average field 3 for each of the unique identifiers found in field 1. However, I only want to average these rows when field 2 is equal to 1506 - 2000 (note that i replaced the values field 2 for security reasons, but the real data are sequential).
001001 1500 62.6283
001001 1501 65.3417
001001 1502 65.1475
001001 1503 63.805
001001 1504 63.9375
001001 1505 64.1858
001001 1506 62.29
001001 1507 64.5242
001001 1508 62.8933
001001 1509 64.0667
001001 1510 63.6867
.....
001003 1995 66.7417
001003 1996 66.1092
001003 1997 66.5117
001003 1998 68.6833
001003 1999 67.715
001003 2000 67.5867
001003 2001 66.9783
001003 2002 67.3217
001003 2003 66.7042
001003 2004 67.1367
001003 2005 67.3717
.....
I need the results appended to each respective row.
001001 1500 62.6283 63.49
001001 1501 65.3417 63.49
001001 1502 65.1475 63.49
001001 1503 63.805 63.49
001001 1504 63.9375 63.49
001001 1505 64.1858 63.49
001001 1506 62.29 63.49
001001 1507 64.5242 63.49
001001 1508 62.8933 63.49
001001 1509 64.0667 63.49
001001 1510 63.6867 63.49
.....
001003 1995 66.7417 67.22
001003 1996 66.1092 67.22
001003 1997 66.5117 67.22
001003 1998 68.6833 67.22
001003 1999 67.715 67.22
001003 2000 67.5867 67.22
001003 2001 66.9783 67.22
001003 2002 67.3217 67.22
001003 2003 66.7042 67.22
001003 2004 67.1367 67.22
001003 2005 67.3717 67.22
.....
Any help is appreciated.