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.

FlatFileAdapter_ProductExport_Example

Click the icon to download a simple example model that shows the usage of the Flat File adapter in Scheer PAS Designer.

Define a dedicated FlatFileRecord class for the header record and add it to the FlatFile class.

It is not possible to use header record information to define dynamically attribute names of the following data records.

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

It's strongly recommend to use evaluationOrder in such cases. If you do not specify an evaluation order, the order of processing is undefined and random.

  • No labels