2018.2

Table Of Contents
Beatles Yellow Submarine 1968
Led Zeppelin Led Zeppelin 1 1969
Led Zeppelin Led Zeppelin 2 1969
Beatles Let it be 1970
Rolling Stones Let it bleed 1969
Led Zeppelin Led Zeppelin 3 1970
Led Zeppelin Led Zeppelin 4 1971
Rolling Stones Sticky Fingers 1971
The purpose of the script, again, is to set the record boundary when EITHER the year OR the
artist changes.
The script would look like this:
/* Read the values of both columns we want to check */
var zeBand = boundaries.get(region.createRegion(1,1,30,1));
var zeYear = boundaries.get(region.createRegion(61,1,65,1));
/* Check that at least one of our variables holding previous values
have been initialized already, before attempting to compare the
values */
if (boundaries.getVariable("lastBand")!=null) {
(zeBand[0]!=boundaries.getVariable("lastBand") || zeYear
[0]!=boundaries.getVariable("lastYear"))
{
boundaries.set();
}
}
boundaries.setVariable("lastBand",zeBand[0]);
boundaries.setVariable("lastYear",zeYear[0]);
This script uses the exact same code as used for CSV files, with the exception of parameters
expected by the createRegion() method. The get method adapts to the context (the data source
file) and therefore expects different parameters to be passed in order to achieve the same thing.
Since a text file does not contain column names as a CSV does, the API expects the text
regions to be defined using physical coordinates. In this instance: Left, Top, Right, Bottom.
To try this code, paste the data into a text editor and save the file to Albums.txt. Then create a
new DataMapper configuration and load this Text file as your data file. In the Data Input
Page 327