I have multiple files of same length and RECFM with each file having a header and a trailer.I need to merge all the files into 1 file with a single header and trailer.
Note:The header should contain the latest time stamp and the trailer should contain the total no. of records in all the files.The header can be identified by a starting 'H' and a trailer by a starting 'T'.
Pls make the solution generic as we have to merge different types.But the similarity between all the types of files is the Header will start with a 'H' followed by the date (may be once or twice) and the trailer with a 'T' followed by the count.
The most recent header to be populated in the output file wud be the best choice.
Pls let me know if more information is reqd.