For a flat file that contains a header row, you can easily filter out the header row while processing the file. The example below implements such a behavior.
Define a dedicated FlatFileRecord class for the header record and add it to the FlatFile class.
By specifying lineNumber=1, the first record is processed into class Header. If the flat file has more than one header record, you must specify a FlatFileRecord class for each of the header records and set lineNumber accordingly.
Due to the fact that there are multiple FlatFileRecord classes on the same level, the attribute evaluationOrder manifests the order in which the records occur in the file:
- Header: Evaluation order = 1
- Product: Evaluation order = 2