Arrays
Arrays are a new feature since 9.0.
An array is a special variable that stores 1-D or 2-D data in a
file within the ..data\variables folder. The array files are named
using the following
format:
ARRAY--tasktitle--variablename
Example:
ARRAY—copytest--Filenames
You
can get the values of an array variable using the the following
format:
$%ARRAYNAME::FIRSTROW%$
$%ARRAYNAME::LASTROW%$
$%ARRAYNAME::ALLROWS%$
$%ARRAYNAME::FIRSTCELL%$
$%ARRAYNAME::LASTCELL%$
$%ARRAYNAME::ROW::rownumber%$
$%ARRAYNAME::CELL::rownumber::columnnumber%$
examples:
$%ARRAY—taskTitle--variable::FIRSTROW%$
$%ARRAY—dirlisting--DirectoryListing::FIRSTROW%$
You can view the contents of an array using the Variables menu / Task Variables window.
An array is typically 2 dimensional. The most common array is the Filenames variable in the Copy or Ftp tasks. When a variable value can potentially become very large, it is stored in its own array file. The Filenames variable in the Copy,Ftp,SFtp tasks, list each filename in a new row (line). Each row contains multiple columns for the files properties like name, size, timestamp and directory path etc..
There are various tasks that work with arrays:
1) Array read
task - read the value of any cell or row within the array.
2)
Array loop task – loop and read value of all cells/rows and run
another task every loop
3) ArrayToFilename task – Converts
an array into a filename variable (#file1^#file2^#file3)
4)
FilenameToArray task – Converts a filename variable into a 1-D
array. One filename per line (row).