Dear Knimers,
while researching my previous post, I was surprised by the following behavior:
This yields the table:
Now I want to loop over (column1, column2) with a column list loop:
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:
and
The result is:
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