This node allows you to execute arbitrary Perl script to create a new column or to replace an existing one.
The preface script is run once before the data from the input table is read. It can be used to define variables which will be available in the body script.
The body script is run for each row. The predefined variables
$ROWKEY
and $ROWINDEX
give the key of the row
and its index, respectively. To address certain input values
use the predefined hash $column
.
For instance, the value of the column with name frequency
can be obtained by $column{'frequency'}
. When
frequencies
is a collection cell,
$column{'frequencies'}
is a reference to an array so
that the first element
of frequencies
can be obtained by
$column{'frequencies'}[0]
. Note, that the character "'"
in the column name must be escaped by "\'".
Beside the predefined hash $column
there is an array
called $column_names
which holds column names
(the keys of $column
) in same order as in the input table.
The output of your script is the value of the last expression, or
can be specified by the return
statement.
Please, return a reference
to an array when the output is of collection type, or undef
when the output should be a missing cell.
$column
Its keys are the column names of the input table. The output is the
value of the last expression, or can be defined by the return
statement. Please, return a reference
to an array when the output is of collection type, or undef
when the output should be a missing cell.You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.
To use this node in KNIME, install the extension KNIME Perl Integration from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Deploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.