Example of Number of Lines splitter

Here is an example of a series of records before a split, based on the number of lines:
Header Records
Replacement Parts Prices
Replacement Parts Prices
Remanufactured Parts Prices
Replacement Parts Prices
Remanufactured Parts Prices
Replacement Parts Prices
Replacement Parts Prices
Remanufactured Parts Prices
Trailer

When a channel receives an incoming large file, the message is split based on split after X number of rows. When the message reaches the x number of lines and there is no split record, the next record is checked. If the checked record still has no split, it is not included. If the checked record has a split record, it is included in the split.

Logically, here is how it works:
  1. If the last record matches 'Remanufactured Parts Prices', the file is split from this point.
  2. Then, if the last record matches 'Replacement Part Prices', one more record is read.
  3. Then, if the next record matches 'Remanufactured Parts Prices' it is included, and the split starts from this point.
  4. Then, if the next record matches 'Replacement Part Prices' it is not included, and the file splits here for the next flat message.
After a split, every flat file message created has a pair of header and trailer based on the original data.
Header Record (1)
Replacement Parts Prices
Replacement Parts Prices
Trailer (1)

Header Record (2)
Replacement Parts Prices
Remanufactured Prices
Trailer (2)

Header Record (n)
Replacement Parts Prices
Replacement Parts Prices
Replacement Parts Prices
Remanufactured Prices
Trailer (n)