Parsing Simple Flat Files
This page explains the Flat File Adapter in Bridge context. If you were looking for the same information regarding the PAS Designer, refer to Flat File Adapter in the Designer guide.
The most simple flat file type is a position delimited file without header or trailing lines. The explanations in this chapter refer to the following example:
Example File (Builder project Add-ons/FlatFiles):
<your example path>\Add-ons\FlatFile\uml\flatFileFixLength.xml |
Figure: Simple Fixed Position Flat File
The class diagram describing this file looks like:
Figure: Class Definition For Simple Fixed Position File
To parse or compose this fixed position file, the file is modeled as a <<FlatFile>> class with an association of a <<FlatFileRecord>> class. You can name theses classes as you like. In this example, the classes were created automatically by the E2E Flat File Definition Importer from a flat file definition file. The class names were applied during the import and we called the classes after the file resource DVD_List respectively DVD_List_Record.
All records have the same fields with a given fixed position length. Numeric values can be represented by attributes having an according type (Integer or Float). The parsing and composing of such values can be influence via tagged value format.
Leading zeros and trailing spaces can be created/removed while composing/parsing by the tagged value padding. Note that this is works only for fixed position files.