Replace values in Tables with Table¶
Searches for and replaces values in specified columns using a table
Documentation
Auto generated list version of Replace values in Table with Table.
In this version, the following ports from the original nodes have been changed to lists which the node loops over:
- Looped Inputs
data.
- Looped Outputs
data.
For details see the original node.
Definition
Input ports
- expressions
table
Expressions
- data
[table]
Table Data
Output ports
- data
[table]
Table with replaced values
- Configuration:
- Columns to replace values in (column)
Select in which to perform replace
- Column with search expressions (find)
Select which column contains search expressions
- Ignore case (ignore_case)
Ignore case when searching
- Text replace only (using regex) (literal)
Perform regex replacements in string columns, i.e., columns with types text and bytes, other columns are ignored. Disable this option to replace full values, without using regex across all types of columns.
- Column with replace expressions (replace)
Select which column contains replacements
In the standard library there exist four nodes which perform a search and replace of values among the elements in Tables. Of the four nodes, one operates on single Table while the second operates on multiple Tables. The third and fourth are the same but instead of a GUI configuration, they take another table as configuration. See below.
In the configuration of the nodes one has to specify the columns in the Tables which will be regarded during the execution of the node. The node works with string, unicode, integer, and float values.
In general, search and replace expression should be scalar literals
For string and unicode columns the search and replace expressions may be
regular expressions. Here, it is possible to use ()-grouping in the search
expression to reuse the match of the expression within the parentheses in the
replace expression. In the regular expression for the replace use
\\1
(or higher numbers) to insert matches.
As an example let’s say that you have an input table with a column containing
the strings x
, y
, and z
. If you enter the search expression
(.*)
and the replace expression \\1_new
the output will be the
strings x_new
, y_new
, and z_new
.
For the expression table (for the ‘with Table’ versions) it should it have the following structure:
Search column |
Replace column |
---|---|
Expression to search 1 |
Replace for expression 1 |
Expression to search 2 |
Replace for expression 2 |
… |
… |
Unless configured to use regex replacement, search, replace and default values will be read as a values of the same type as the column it is replacing in. For information about how to enter text, see Input typed values as text.
- class node_table_value_search_replace.TableValueSearchReplaceWithTableMultiple[source]
Related nodes