1.8

Table Of Contents
Text file: setting the height to 0
If the variable part in a TXT file is at the end of the record (for example, the body of an email)the
height of the region to extract can be set to 0. This instructs the DataMapper to extract all lines
starting from a given position in a record until the end of the record, and store them in a single
field.
This also works with the data.extract() method in a script; see "Examples" on page271.
Finding a condition
Where it isn't possible to use a setting to extract data of variable length, the key is to find one or
more differences between lines that make clear how big the region is from where data needs to
be extracted.
Whilst, for example, a product description may expand over two lines, other data - such as the
unit price - will never be longer than one line. Either the line above or below the unit price will
be empty when the product description covers two lines.
Such a difference can then be used as a condition in a Condition step or a Case in a Multiple
Conditions step.
A Condition step, as well as each Case in a Multiple Conditions step, can only check for one
condition. To combine conditions, you would need a script.
Using a Condition step or Multiple Conditions step
Using a Condition step ("Condition step" on page145) or a Multiple Conditions step ("Multiple
Conditions step" on page148) one could determine how big the region is that contains the data
that needs to be extracted.
In each of the branches under the Condition or Multiple Conditions step, an Extract step could
be added to extract the data from a particular region. The Extract steps could write their data to
the same field.
Fields cannot be used twice in one extraction workflow.
Different Extract steps can only write extracted data to the same field in the Data Model, if:
l The field name is the same. (See: "Renaming and ordering fields" on page158.)
l The Extract steps are mutually exclusive. This is the case when they are located in
different branches of a Condition step or Multiple Conditions step.
l
The option Append values to current record is checked in the Step properties pane
under Extraction Definition.
Page 136