Parameter Example: Using Array to Select Columns

Array parameters can be used instead of specific column names in objects that let you check columns to keep or to remove. This includes the FileIn, Alias, Break, Filter, Sort, Squash and FileOut objects.

As an example, assume that columns.txt contains a list of columns that must be kept, and an array parameter called columnlist has been created to use this file.

Text File with List of Column Names

Parameter definition

In the FileIn object, instead of checking the Keep box for these specific columns, use add line in the context menu to add the array parameter to the list of columns. That is, right-click on a line in the Column Grid and select Add Line from the pop-up.

Context Menu for Column Grid

In the dialog box that appears, insert the parameter.

Add Line Dialog

The list of columns has been expanded and now features an additional line with $(columnlist) and Keep selected.

Column Grid with Parameter

The $(columnlist) is shorthand for all the columns in the array parameter file. Checking Keep keeps all the columns in the array parameter file for use in the next object.

Note that the same procedure can be used in many different objects, allowing you to create dynamic scripts—reusable scripts that are driven by parameter files.

TIP: When using an array to select columns for a Sort or Break object, the output order is dictated by the order of the column names in the array parameter text file.