Breadcrumbs

Flat File Adapter Reference


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.

Tagged Values

Class <<FlatFile>>

This is the root record of the flat file declaration. This class cannot have any attributes, only associations to <<FlatFileRecord>> classes and <<FlatFileGroup>> classes are allowed.


Tagged Value

Description

Allowed Values

Example

escapeCharacter

Defines the character used for escaping when a reserved character is used within a field value.

any character

/

fillCharacter

Defines a dummy character to fill non-existent values (results in NULL). Used for fixed attribute layout only.

any character

0

quoteCharacter

The quoteCharacter will be ignored by reading field value.

any character

/

recordSeparator

Separator of the different records, normally line feed and carriage return. For serialized files, any other character can be defined.

any character or one of

<newline>

<esc>


<newline>

parses correctly on Unix and Windows platforms

<space>


<tab>


<tabulator>


<unixnewline>

composes newline

<windowsnewline>

composes newline and carriage return

reservedCharacters

Defines a list of characters to be escaped automatically when the file is composed.

any character

{"/", "%", "&", "(", ")"}


Class <<FlatFileRecord>>

This class describes the attributes of a record. A record is one "line" in a file and can consist of multiple attributes.


Tagged Value

Description

Allowed Values

Example

attributeLayout

Defines the attribute layout (fixed or separated) of the flat file record.

  • Fixed: For attribute values that are shorter than the maximum length of the field, the field is filled with a fill character. As per default, this is blank space, but you can change the fill character in tagged value fillCharacter of the <<FlatFile>> class (see Tagged Values of Class <<FlatFile>>).

  • Separated: If separated is used, specify the separator using attributeSeparator (see below).

fixed

fixed attribute layout


separated

separated attribute layout

attributeSeparator

Defines the attribute/field separator.

any character

use this character as attribute separator


<Tab>

use tabulator as attribute separator

attributePattern

A RegEx pattern to parse the record content into the attributes using capture groups.

a valid regular expression

^(.?)(://)([A-Za-z0-9.])(:[0-9])(/.)$

evaluationOrder

Defines the order in which the association of the classes starting on same parent class must be processed, see (25.1) Flat File Adapter Parsing Process.

any integer


ignoreEmptyRecords

Boolean value for ignoring empty records. If set to true, no item will be generated, if none of the defined attributes or sub records have any content.

Note, that a record containing only empty Strings is not empty – in opposition to a record composed from NULLs. See ignoreEmptyStrings below to skip processing of records containing only empty Strings.

true

ignore empty records


false (default)

process empty records

ignoreEmptyStrings

Boolean value for ignoring empty string attributes. If set to true, empty string values will be processed to NULL.
Use this tag in combination with ignoreEmptyRecords to skip processing of records containing only empty Strings.

true

ignore empty string values


false (default)

preserve empty string values

lineNumber

Specifies the number of a record in the file. The first record is lineNumber=1, the second lineNumber=2, etc.

any integer


pattern


Error rendering macro 'multiexcerpt' : Page loading failed


any character


a valid regular expression

^Pattern.*

suppressEscaping

Boolean value to suppress escaping. If suppressEscaping on a <<FlatFileRecord>> is true, <<FlatFileComplexAttribute>> that are part of this record will inherit this setting.

true

attribute values of this record will not be un-escaped (parser) or escaped (composer)


false

escaping/un-escaping is not suppressed

parseMacro


Error rendering macro 'multiexcerpt' : Page loading failed


any valid macro expression (see Macro Expressions)

GetCounter(AUTO0)

composeMacro


Class <<FlatFileGroup>>

This class is used to group multiple records into one (virtual) structure. A group does not have a representation in the flat file itself.


Tagged Value

Description

Allowed Values

Example

pattern

Error rendering macro 'multiexcerpt-include' : Page loading failed

any character

^Pattern.*

a valid regular expression


Class <<FlatFileSubRecord>>



Tagged Value

Description

Allowed Values

Example

condition

A condition that must evaluate true if the record exists. The condition can refer to a self object which represents the current state of the parent.

any valid conditional expression

self.UNS.exists()

evaluationOrder

Defines the order in which the associations starting on same parent class must be processed, see (25.1) Flat File Adapter Parsing Process.

any integer


offset

Define the position of this record in the flat file, starting with 0 for the first record and always relative to the parent element.

any integer



Attribute <<FlatFileAttribute>>

Fixed Layout


There were errors rendering macro:

  • An unknown error occurred.


Separated Layout


Tagged Value

Description

Allowed Values

Example

format

Error rendering macro 'multiexcerpt-include' : Page loading failed



order

The evaluation order of the attributes. If offset is not used, order reflects the field number within the record.

any integer

offset

The relative position of the field in respect of the other fields in the record, e.g. field number 3 has offset = 2.

any integer


suppressEscaping

Error rendering macro 'multiexcerpt-include' : Page loading failed



parseMacro

Error rendering macro 'multiexcerpt-include' : Page loading failed

any valid macro expression (see Macro Expressions)

GetCounter(0)

composeMacro


Attribute <<FlatFileComplexAttribute>>

This class is used to divide fields into sub-fields. You can think of this like a <<FlatFileRecord>> placed within a single field.


There were errors rendering macro:

  • An unknown error occurred.


Action "parse"


There were errors rendering macro:

  • An unknown error occurred.


Parameters

Action "compose"


There were errors rendering macro:

  • An unknown error occurred.


Action "parse"


Name

Type

Direction

Mandatory

Description

Allowed Values

Example

data

Blob

in

(

https://scheer-pas-doc.atlassian.net/wiki/s/-9052783/6452/97cc5eb0f698b4294a72ce29635818407b50c272/_/images/icons/emoticons/check.png

)

Provide the flat file data to be parsed.
Alternatively, you can specify a path to a flat file in the file system (see parameter name). Note, that the name parameter takes priority over data.



name

String

in

(

https://scheer-pas-doc.atlassian.net/wiki/s/-9052783/6452/97cc5eb0f698b4294a72ce29635818407b50c272/_/images/icons/emoticons/check.png

)

Specify a full path to the flat file to be parsed.
Alternatively, you can parse the flat file from a Blob object (see parameter data). Note, that the name parameter takes priority over data.


tmp/myFile.txt

encoding

String

in


Provide the encoding of the file to be parsed as specified in the (25.1) Charset Definitions appendix.

any valid encoding (see (25.1) Charset Definitions)

UTF-8

default

ISO-8859-1 (Latin1)

locale

NumbersLocale

in


Specify how number values will be treated, when parsed from the flat file (decimal point, currency symbol, ...). You can overwrite the system locales here, if the file was written with divergent locales. Refer to (25.1) Number Formatting for more information.



<any>

<<FlatFile>>class

out

https://scheer-pas-doc.atlassian.net/wiki/s/-9052783/6452/97cc5eb0f698b4294a72ce29635818407b50c272/_/images/icons/emoticons/check.png

The adapter returns a parsed flat file object. The class defining the type of this object should have stereotype <<FlatFile>> and should depict the structure of the file.



If you provide both parameters, name and data, the <<FlatFile>> object will be parsed from the file system. If you specified tagged value resource (see section Flat File Adapter Reference#Tagged Values), the file will only be parsed from the resource.


Parameter Types

Error rendering macro 'multiexcerpt-include' : Page loading failed

Related Pages: