How to rename a column originally named as the current month?

Hi, I need to rename a column with x name using Column Rename node, however the column’s original name will change each month. So for example this month the column I need to rename will be named DEC 2018, but next month it’s going to be JAN 2019.

I tried getting the current date as a variable using Date&Time Input and String Manipulation nodes but I don’t know how to rename the column that has the same name as the variable.

Thanks in advance.

Hi @_Aura_C2 -

Here’s one way you could do it.


RenameColumnCurrentDate.knwf (14.8 KB)

Hi @ScottF,

Thanks for the workflow but not quite what I need. You are renaming a column (NewCol) with the name in the variable, and I need to do the opposite that would be rename a column that already has the dynamic date as header (DEC 2018 --> rename --> NewCol) considering that the date (input column) will be different each month.

Most likely your monthly column has same order place. So, using Column Expression node you can address column by number. Also, you can extract and assign header to the table using Extract Column Header and Insert Column Header nodes.

What about a Column Rename (regex) node? The regex could be something like:
…including brackets and spaces.
(Cannot test it at the moment because i am on mobile, let me know if it doesnt work)

Thanks this might be a good option I will try it!