The input :
Header: date1 time 1
Data item A
Data item A
Data item A
Data item A
Data item A
Header: date1 time2
Header: date1 time3
Header: date1 time4
Header: date2 time1
Header: date2 time2
Header: date2 time3
Header: date2 time4
Data item B
Data item B
Data item B
Header: date2 time5
Header: date2 time6
Header: date2 time7
Data item C
Data item C
Data item C
Data item C
Header: date2 time8
Header: date3 time1
Data item A
Data item A
Data item A
Data item A
Data item A
Header: date1 time2
Header: date1 time3
Header: date1 time4
Header: date2 time1
Header: date2 time2
Header: date2 time3
Header: date2 time4
Data item B
Data item B
Data item B
Header: date2 time5
Header: date2 time6
Header: date2 time7
Data item C
Data item C
Data item C
Data item C
Header: date2 time8
Header: date3 time1
The output:
Header: date1 time 1
Data item A
Data item A
Data item A
Data item A
Data item A
Header: date2 time4
Data item B
Data item B
Data item B
Header: date2 time7
Data item C
Data item C
Data item C
Data item C
Data item A
Data item A
Data item A
Data item A
Data item A
Header: date2 time4
Data item B
Data item B
Data item B
Header: date2 time7
Data item C
Data item C
Data item C
Data item C
The record length is 40 and fix.
Thanks very much!