I have two files, one containing a key value (unique values, one per line) and the other containing records eacho of which contains one of the key values. There may not be any records in the second file for a particular key value and there could also be multiples. Key value file has been sorted and run through uniq so there is one and only one of each value in the file.
What I need to do is read each value in the key file one at a time and use it to grep out all records containing that key value from the second file. Those selected records will then be sorted and the last record will be copied to a working file for further processing.
I know how to all of it except getting the key value file opened and each value into a working variable in the .ksh script. The grep, sort, tail, etc. aren't an issue - but darned if I can read each value, one by one, from the input file.
Appreciate any comments.
Tnx as always.
Tom
"My mind is like a steel whatchamacallit ...
What I need to do is read each value in the key file one at a time and use it to grep out all records containing that key value from the second file. Those selected records will then be sorted and the last record will be copied to a working file for further processing.
I know how to all of it except getting the key value file opened and each value into a working variable in the .ksh script. The grep, sort, tail, etc. aren't an issue - but darned if I can read each value, one by one, from the input file.
Appreciate any comments.
Tnx as always.
Tom
"My mind is like a steel whatchamacallit ...