Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Regex Parse - Varying Name Formats

nalefe
5 - Atom

 

Greetings

 

I am trying to separate first and last names into two columns. The list of names currently has the following format and variations. Can this be done with one Regex tool? Regardless, is there a relatively straightforward way to accomplish this?

 

Washington, Jr., William B.

Billington, Stephanie

D'esky, Don A.  

Smith, Sr., Sara

 

Thanks for your time!

 

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

@nalefe

 

Capture.PNG

 

Using the Regex Parsing tool, I set the Regular Expression to:

(.*),(.*)

Set the Output method to Parse.

You can rename the out1 and out2 fields to Last Name and First Name.

 

Cheers,
Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MinaGO
7 - Meteor

Alternatively to the prior comment, you could use the text to columns tool, simply set it to two columns and put , as the delimiter.Screenshot (295).png

SophiaF
Alteryx
Alteryx

@nalefe - having multiple commas is the tricky piece here. You want it to always split on the last comma; this piece of regex should do that:

 

(.+),(.[^,]+)
Sophia Fraticelli
Senior Solutions Architect
Alteryx, Inc.
nalefe
5 - Atom

Al three solutions seem to work. Thanks!

Labels