Input file Description:-
1. First Byte shows H - Header D- Detail T-Trailer records
2. In Header record, from position 2 to pos 9 -> header date
3. in Detail Record, from Pos 11 to pos 18 -> date field
4. In Trailer record, from pos 2 to pos 8 is the trailer count.
5. Date format is 'DDMMYYYY'
1. Need to copy the header record as it is
2. records with the latest date need to be taken out for detail records.
3. Also latest date in the detail record should match with the header date
4. Correspondingly trailer count needs to be written based on the no of detail records.
Sample Output file is given below.