2018.2

Table Of Contents
Accessing data
Data available inside each event
Every time a delimiter is encountered, an event is triggered and the script is executed. The
event gives the script access to the data between the current location - the start of a row, line or
page - and the next delimiter. So at the beginning of the process for a PDF or text file, you have
access to the first page only, and for a CSV or for tabular data, that would be the first row or
record.
This means that you can:
l Examine the data found in between delimiters for specific conditions.
l Examine specific regions of that data, or the available data as a whole.
l Compare the contents of one region with another.
l Etc.
To access this data in the script, use the get() function of the boundaries object. This function
expects different parameters depending on the type of source file; see "Example" on page333.
Getting access to other data
Data that is not passed with the event, but that is necessary to define the record boundaries,
can be stored in the boundaries object using the setVariable function (see "boundaries" on
page330 and "Example" on page335). The data can be retrieved using the boundaries'
getVariable function (see "getVariable()" on page333).
This way the script can access values that were evaluated in previous pages or rows, across
delimiters, so you can easily set record boundaries that span over multiple delimiters.
For more information on the syntax, please refer to "DataMapper Scripts API" on page318.
Examples
Basic example using a CSV file
Imagine you are a classic rock fan and you want to extract the data from a CSV listing of all the
albums in your collection. Your goal is to extract records that change whenever the artist OR
the release year changes.
Here's what the CSV looks like:
Page 324