Feature suggestion: a "whole string / all occurrances" switch for the Column Rename (Regex) node

Dear Knimers,

while researching my previous post, I was surprised by the following behavior:
image

This yields the table:
image

Now I want to loop over (column1, column2) with a column list loop:
image

The config of the Column List Loop Start is:

The Column Rename (Regex) is there to rename the current column of the loop to “CurrentColumn”, a common workflow pattern I think:
image
and
image

The result is:
image

Instead of the Column Rename (Regex) node only changing the current column of the loop, it also changes the name of every other column that has a substring that corresponds to the current column name. I think this is undesirable behavior in many situations. This could be solved by not choosing “Literal” and changing the currentColumnName flow variable into a regular expression starting with “^” and ending with “$”, but this is kind of cumbersome.

I suggest adding an option to the Column Rename (Regex) to switch between “whole string” and “all occurrances”. The “String Replacer” node already has a similar switch.

Best
Aswin

Hi Aswin,

I think this is a really good point! I created a ticket for our developers for it.Thank you for the great input!

All the best,
Jeany

3 Likes

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