Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Parse Initials

CPAul
7 - Meteor

RegEx questions here... From a listing of names, I'm trying to parse out all instances where an initial is used, for example:

 

John T. Smith             =       John Smith

J. Thomas Smith        =       Thomas Smith

John Smith                 =       John Smith

John Thomas Smith   =      John Thomas Smith

 

Thank you!

Paul

3 REPLIES 3
Emil_Kos
17 - Castor
17 - Castor

Hi @CPAul,

 

Probably you can do it in a more elegant way but this should work for you.

 

What I am doing here is looking for one letter with a dot after it. I am removing those with the data.

 

Emil_Kos_1-1610382306825.png

The output:

 

Emil_Kos_0-1610382298429.png

 

 

echuong1
Alteryx Alumni (Retired)

This is easily achievable with regex. In the expression, I am looking for an instance of a letter followed by a period. I am replacing it with nothing, thereby removing it.

 

I added a data cleansing to remove any leading and trailing spaces, should the initial be at the beginning or end. I also removed duplicate whitespace, for instances of the initial in the middle.

 

echuong1_0-1610382282133.png

 

ponraj
13 - Pulsar

Here you go. Hope this is helpful. 

 

Workflow.PNG

Labels
Top Solution Authors