I am looking for assistance with gawk on windows (not sure if it's windows specific or not, just where I'm processing).
I have a tab delimited file structured as follows:
(headings: season, year, gradelevel, studentid, name, test,score)
Fall 2010 9 99896 SCOTT, Joe Reading 175
Fall 2010 9 99896 SCOTT, Joe Mathemati 172
Fall 2010 9 99893 EKLUND, BRITTANY Reading 165
Fall 2010 9 9989 HASNER, EDWARD Reading 208
Fall 2010 9 9989 HASNER, EDWARD Mathemati 229
Fall 2010 9 99880 REED, TREY Reading 210
Fall 2010 9 99880 JONES, TOM Mathemati 220
the deired end result is:
Fall 2010 9 99896 SCOTT, Joe Reading 175 Mathemati 172
Fall 2010 9 99893 EKLUND, BRITTANY Reading 165 Mathemati 171
Fall 2010 9 9989 HASNER, EDWARD Reading 208 Mathemati 229
Fall 2010 9 99880 REED, TREY Reading 210
Fall 2010 9 99880 JONES, TOM Mathemati 220
basically, if column 4(studentid) of the next record is the same as current, get the associated score,
when the ID is different write the current record to the new file.
I have multiple iterations of gawk commands but have not come up with the right ones.
If anyone would provide assistance, I would certainly appreciate it.
bob
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|