There will be times when you need to process multiple columns with the same operation. There are a few ways to accomplish this within a visual preparation script.
In the Column View, you can select multiple columns and choose an operation from the Actions menu to apply to the selected columns. This creates a new step in the Script, and is essentially a shortcut to manually creating the step. It is especially useful for processors that cannot be extended to multiple columns in the step editor.
For example, you may have several columns that relate to a customer’s home contact information. In order to help differentiate this from their work contact information, you can go to the Column View, select the columns, select Rename from the Actions menu, and then add
home_ as a prefix to the columns.
The new step in the script is a Rename processor that renames each column individually.
Some processors can be extended to multiple columns within the step editor. These processors have several modes for specifying the column.
For example, you may want to fill empty cells of a column with the value
Unknown. With the mode set to:
.*zip.*selects home_zip and work zipcode.
It is also possible to process multiple columns using a Python function. This is especially useful for processors that cannot be extended to multiple columns within the step editor.
In the example below, the
process function adds 5 to the integer-valued columns.