String Manipulation Value extraction for new Row Key

Hello,

from a loop (the option leave “Rowid unmodified” is not possible, because I loop thru a list to check if rows contain specific words) the final result looks like “Row0_114#0” the final result should be “Row114”.

I tried the String Manipulation Node with RegEx (regexReplace($RowNr$,"/Row\d_","")), but no change. Second question, is this possible with one String Manipulation Node?

BR,
Sven

Hi,

to get the 114 the RegEx is (?>Row\d_)(.\d)(?>#\d), but the String Manipulation Node is not able to extract it.

Br,
Sven

Looks like the result in KNIME differ from a site like https://regex101.com/
Regex101:
Full Match:
Row0_21#0
Group1:
21

In Knime: 0210

br,
Sven

Hello @sven-abx,

I used following expression in String Manipulation on RowID to get Row114 from your input.

regexReplace($$ROWID$$,".*_(\\d+).*" ,"Row$1" )

However you will get this values in new column (can’t replace Row ids in String Manipulation node) and then have to use RowID node to create new ids.

Br,
Ivan

1 Like

Hi @ipazin,

thanks for your answer! It works now.

Many thanks! :smiley:
br,
Sven

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.