When using an Excel document as a source, the header row is used to determine the names of the fields for the source connector. In order to ensure the field names will be consistent, one can insert a row into the beginning of each document before it is processed. For example, today our client sent us an Excel document that contained the following header in column A: “Account Number”, but yesterday, the value in column A was: “Acct Num”.
Dynamically inserting a static header row into an Excel document allows for the processing of Excel documents regardless of whether or not they contain a consistent header row from the client.
This should be done when you are asked to process an Excel document that is missing a header row or does not have a consistent header row.
The use of consistent column headers is beneficial to the:
- Developer – Implements the code to add a header row to the Excel document prior to processing.
- End User – Is able to review and utilize the new data loaded into the system.
Inserting a header row to an Excel document is implemented using a RIFL step within Pervasive Data Integrator Process Designer.
Before the Excel document is processed, use a RIFL step to open the document and insert a static header row at the beginning of the document that matches the column names identified in the Map’s source schema. If the file may come in with or without a header, you can add a Source Filter to your Map that processes the Excel document. The filter can validate each row to filter out any extra or unwanted header rows and rows that only contain whitespace, which will allow you to process the data in the document successfully.
Subscribe to the Emprise Technologies YouTube channel to access our library of video demos.