In an attempt to anonymize my data, I'm using a multi-field formula with REGEX to replace customer names in the data, and a dynamic rename with REGEX to replace customer names in field headers, like this:
Multi-Field:
IF
findstring([_CurrentField_], “Cust1”)!=-1 then
REGEX_Replace([_CurrentField_], “Cust1”, "John")
elseif findstring([_CurrentField_], “Cust1”)!=-1 then
REGEX_Replace([_CurrentField_], “Cust1”, "Paul")
else [_CurrentField_] endif
Dynamic Rename:
IF
findstring([_CurrentField_], "Cust1")!=-1 then
REGEX_Replace([_CurrentField_], "Cust1", "John")
elseif findstring([_CurrentField_], "Cust2")!=-1 then
REGEX_Replace([_CurrentField_], "Cust2", "Paul")
else [_CurrentField_] endif
The thing is, I can get away with this because I'm only replacing a small number of strings. But what if there were many strings to replace?
Is there a simpler way to accomplish this than 2 full paragraphs of REGEX code?