HP3000-L Archives

November 2010, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bob McGregor <[log in to unmask]>
Reply To:
Bob McGregor <[log in to unmask]>
Date:
Tue, 2 Nov 2010 14:02:33 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
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 *

ATOM RSS1 RSS2