2019.1

Table Of Contents
page390 and "Example" on page395). The data can be retrieved using the boundaries'
getVariable function (see "getVariable()" on page393).
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 page378.
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:
"Artist","Album","Released"
"Beatles","Abbey Road",1969
"Beatles","Yellow Submarine",1969
"Led Zeppelin","Led Zeppelin 1",1969
"Led Zeppelin","Led Zeppelin 2",1969
"Beatles","Let it be",1969
"Rolling Stones","Let it bleed",1969
"Led Zeppelin","Led Zeppelin 3",1970
"Led Zeppelin","Led Zeppelin 4",1971
"Rolling Stones","Sticky Fingers",1971
Note
The first line is just the header with the names of the CSV columns. The data is already
sorted per year, per artist, and per album.
Your goal is to examine two values in each CSV record and to act when either changes. The
DataMapper GUI allows you to specify a On Change trigger, but you can only specify a single
field. So for instance, if you were to set the record boundary when the "Released" field
changes, you'd get the first four lines together inside a single record. That's not what you want
since that would include albums from several different artists. And if you were to set it when the
"Artist" field changes, the first few records would be OK but near the end, you'd get both the Led
Page 385