If a field from a variable data file upload continas the person's name in a format of LastName, FirstName (in the same field), can we reverse the order of the names?

EDOCBUILDER > eDocBuilder FAQs
Question:
If a field from a variable data file upload continas the person's name in a format of LastName, FirstName (in the same field), can we reverse the order of the names?  For example, I want the salutation to read Dear FirstName LastName
 
Answer:
Assuming there is only one comma in the field, this vb script should accomplish your goal:
 
replaceregex(lastfirst, "([^,]*), ?([^,]*)", "$2 $1")
 
lastfirst is the name of the field that would contain the name.  You would need to replace that with the actual field name on your template.  This will work with or without a space after the comma in the lastfirst field.  For example,  both "Presser,Ross" and "Presser, Ross" would return "Ross Presser" with this script.