Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 24.0
Div
Classe2e-refDiv

Otp
Floatingfalse

Rp

Other Common Flat File Issues:

Children Display
pageSome Common Flat File Issues

Info

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.

Sometimes, flat files contain records without any data but just the field separators, like in line 4 to 7 of this example below:

...

Figure: Flat File

...

Records without Data

Image Modified

There are two ways to skip the records containing no data.

Handle Empty Records With a Pattern

Specify a pattern in tagged value pattern that only matches with the records having data. In our example, the regular expression ^[^;].* supposes that a record is without data when it starts with a separator.

 Figure: Flat File – Exclude Records Without Data

Image Modified

The flat file parser will abort parsing when a record does not match any <<FlatFileRecord>> class. Thus we have to specify a <<FlatFileRecord>> class for the records without data as well.

Class NoData has no pattern. Actually it matches all records, including the records containing data. Thus, it is important to set tagged value evaluationOrder to ensure that this record type will be parsed last on parsing the records.
NoData has no attributes defined, therefore no fields are parsed. Thus, the object of type noData would be created without having any content. To avoid such empty records, set tagged value ignoreEmptyRecords=true on NoData class.

Use Tagged Values on the <<FlatFileRecord>> Class

Use a combination of tagged values ignoreEmptyStrings and ignoreEmptyRecords on the <<FlatFileRecord>> class.

Figure: Flat File – Ignore Empty Records and Strings

Image Modified

Ignoring empty strings will lead to the Flat File Adapter processing empty strings to NULL, and ignoring empty records will lead to the Flat File Adapter not processing a record, if it has no data.

Note
iconfalse

Note, that a record containing only empty Strings is not empty – in opposition to a record composed from NULLs.

Panel
titleOn this Page:
Table of Contents
Panel
titleRelated Pages:

Other Common Flat File Issues:

Children Display
pageSome Common Flat File Issues