I have a file contains Invoice information. Each invoice contains 140 or 150 or more records (not constant).The begining of an invoice can be identified by first two bytes of the record and it is '01' and the rest of the records for that invoice have '02' as the first two bytes.
My requirement is to split this file into 10 files. Write all the records of the first invoice to file1 and all records of the 2nd invoice to file2, etc... in this way all the records for the 11th invoice should go to file1 and so on.
My input file records as below.
01046467490I =====> FIRST INVOICE
02046467490I
02046467490I
02046467490I
02046467490I
.
.
.
02046467490I
01046467491I =====> 2ND INVOICE
02046467491I
.
.
.