Icon

RegEx remove Collection of Characters from multiple Columns

URL: KNIME Forum (77570) https://forum.knime.com/t/remove-special-charactaristics/77570/9?u=mlauber71
URL: RegEx - define a collection of characters that should remain https://forum.knime.com/t/tree-ensemble-learner-does-not-recognize-newlines-in-column-names-include-exclude-filter-does/39753/8?u=mlauber71
URL: RegEx match complete word with special characters - using Rule Engine, Column Expressions, String Manipulation, and Java Snippets https://hub.knime.com/-/spaces/-/~TLYrffX5eQQd9JVL/current-state/
URL: Various Examples of Regex in KNIME https://hub.knime.com/-/spaces/-/~J1anMyaS7MMiRV29/current-state/

A collection of characters to be removed from a collection of string columns

the loop makes sure that special RegEx characters are double escaped for the use in KNIME

https://forum.knime.com/t/remove-special-charactaristics/77570/9?u=mlauber71

if (column("Remove").equals(variable("RegexEscape"))) {

join("\\\\",column("Remove"))

} else {

column("Remove")

}

// capture a possible problem with null values - if not the code might crash

if($${IcurrentIteration}$$ == null) {

return 1;

}

else if ($${IcurrentIteration}$$.equals(0)) {return 0;}

else {return 1;}

collection ofcharacters to remove
Table Creator (deprecated)
regexReplace($$CURRENTCOLUMN$$,$${Sregex_Remove}$$,"")=> select the columns to manipulate.If you want to replace them change the settings
String Manipulation (Multi Column)
Table Transposer
CASE Switch Start
CASE Switch End
_temp.table
Table Reader
_temp.table
Table Writer
_temp.table=> make sure to reset thiswill be overwritten in first iteration only
Table Writer
v_select_port
Java Edit Variable (simple)
join("[",$regex_Remove$,"]")=> construct theRegEx syntax
String Manipulation
regex_Remove
Table Row to Variable
Variable Loop End
_temp.table
Table Reader
result.table
Table Writer
RegexEscape
Table Creator (deprecated)
Column Name Extractor
sample.csv
CSV Reader
regex_Remove
Column Combiner
make sure special RegExcharacters are double escaped
Column Expressions (legacy)
Columns side by sideto checkcan later be removed
Reference Column Resorter
RegexEscape
Table Creator
Table Transposer
Table Row to Variable Loop Start
Sorter
collection ofcharacters to remove
Table Creator

Nodes

Extensions

Links