Flat File Adapter
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.
Any types of flat files can be read and parsed into a class structure using the Flat File Adapter. The flat file structure has to be defined in a class diagram. Any record definitions, separators and even dependencies between different records can be defined there.
The size of one record within a flat file is limited to 4 MB. The size of the file itself is not limited. Be aware, that the Flat File Adapter will parse the file all in once and that it is better to process big files line by line to save resources of your Bridge service during execution. Do do this, use a combination of File System Adapter (to read one record) and Flat File Adapter (to parse one record).
For manipulating files and directories in general, have a look at the File System Adapter.
The handling of different flat file types is shown in the example models referenced below and explained on the related pages.
Example File (Builder project Add-ons/FlatFiles):
<your example path>\Add-ons\FlatFile\uml\flatFileFixLength.xml <your example path>\Add-ons\FlatFile\uml\flatFileHierarchic.xml <your example path>\Add-ons\FlatFile\uml\flatFilePattern.xml <your example path>\Add-ons\FlatFile\uml\flatFileSeparated.xml |
General Approach
A flat file is a file that contains no information about the structure of the data. The most simple flat file is a position delimited file without header or trailing lines.
More complex flat files can have a field delimiter, or can be of hierarchical structure, or can have a pattern to delimit the attributes.
A program that wants to access such a file needs information about the file structure, so you have to provide this in your model via a class diagram. The E2E Flat File Definition Importer of the E2E Builder allows to import flat file descriptions and generates a class model representing the flat file record structure. Alternatively, the flat file structure can be drawn manually as a class diagram or imported from an XML schema.
Flat files can be parsed to a data structure or composed from such a structure to a Blob or to the file system.