i have a data file that looks something like this :
( it is already sorted by date )

12/22/02 abc 123 456 789
12/23/02 def 246 812 98234
12/24/02 ank 987 23456 8762
12/27/02 abc 987 345 65434
01/05/03 abc 876 2356 87
01/09/03 ank 875 234 98098
02/01/03 def 987 3453 456
02/05/03 ghi.th 987 2345 94 

------------

i need the final entry of each unique second field.  in other words, in the 
output file, i would have :

01/05/03 abc 876 2356 87     << last abc entry
02/01/03 def 987 3453 456   << last def entry
01/09/03 ank 875 234 98098 << last ank entry
02/05/03 ghi.th 987 2345 94 << last ghi.th entry


-----------

what i have done so far :
     sort data file by the second field
     while (not end of file) {
          read each record and store it in a temporary array
          keep reading until the second field changes
          if the second field changes {
               write the temporary array to the output file
               store the "just read" record in the temporary array
          }
     }


this seems needlessly complicated.  there has to be a better way.  
suggestions?

thanks

joe

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to