Hello!
So I'm currently trying to rename my column headers with the dynamic rename tool but when I try to use the REGEX_replace it seems to not be working and I feel like I am missing something very obvious. I'm attempting to remove any of the numbers I had added before the underscore plus the underscore itself in order to clean up the column headers,
So instead of having "1_Name", it would be just "Name" Or if down the line it had more than 1 digit such as "25_food" it could also make it just "food"
this all came from myself trying to make the cross tab tool not output in alphabetical order so this seemed like a simple enough solution, but it appears that's not the case haha. Any feedback is greatly appreciated!
Solved! Go to Solution.
Hi @dsucci
To remove the number_ from the field names you can use the bellow expression. The example workflow is attached.
If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)
Thanks.
@dsucci ,
Given, 25_LastName
findstring([name],"_")
will return 2
Substring([name],findstring([name],"_") ,)
should return the rest of LastName
cheers,
mark
regex(_replace([name],".*?_(.*}",'$1')
Hi @dsucci ,
The issue comes from \s in your regex. \s means that there is a white space after digits and it is not the case in headers.
Instead of using \s, replace it with "_" and it will work.
Find details in attachement. Let me know if there is any issue.
Please do not hesitate to mark this answer as solution if it helped.
Thank you @Felipe_Ribeir0 it seems that has done the trick, though everyone else gave very insightful replies as well that i'll look more into for the future.