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
Solved! Go to Solution.
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.
The output:
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.