I am working on a file where I sometimes receive a file with column name let’s say either:
‘Column’
or
‘Column (Name)’
but I only want it to be named only ‘Column’ everytime
what node should I use, if for example I received the file with ‘Column’ THEN no need to rename
but IF ‘Column (Name)’, THEN should be renamed to ‘Column’
I already tried it using a Rule Engine, but I dont think it is possible, since it can only alter values on columns.
This can be easily done using a -Column Rename (Regex)- node:
Please be aware that column names must be unique and therefore this is only valid if you have ONLY one column named “Column (something)”. For instance, this solution would not be valid if you have two columns named “Column (#1)” and “Column (#2)”.
Thank you! It worked! I was considering this solution before posting but don’t know how to write in Regex form and hoping for another solution, but this would suffice.