I have set of records in a file. Each record has a header and trailor record. I want to omit few records based on one field. At the same time, i want to remove header and trailor record for that record also. Can any one please tell me the solution.
AAAA12345 --- Header record
Satish99207AAAA --- 99207 record.
Kumar99207AAAA --- one more record.
Sanju99207AAAA --- one more 99207 record
BBBB12345 --- Trailor record
AAAA12346 --- Again Header record
Rajkum56789jklhm --- other than 99207 record
BBBB12346 ---- Trailor record
AAAA12347 --- again header record
Doneku99207 ---- another data record
BBBB12347 --- Trailor record etc;
Ques: I want to omit 99207 records including hedear and trailor using sort or any other utility