I have a list of names that needs to be parsed into first name and last name (and exclude the rest). It looks like this:
TURNER, JANICE F
VAN DUYN, TAYLOR
BREAULT, JASON D
LOOBY, CYNTHIA M
REILLY, SHAWNMARIE
So the first part of the string (last name) may contain a space but is always followed by a comma. The rest of the string may contain a middle initial, which I want to exclude. The result should look like this:
TURNER JANICE
VAN DUYN TAYLOR
BREAULT JASON
LOOBY CYNTHIA
REILLY SHAWNMARIE
Solved! Go to Solution.
technically you don't really need regex for this. you could do a substring from 0 to the findstring of "," within your string, that will get you the last name.
then another substring of everything AFTER the findstring of "," will be the first+middle.
from the new first+middle column, do a text to columns tool, with a space delimiter. we'll assume anywhere there's a space, it's separating first and middle name.
i got the regex to work too. i think substring/findstring is computationally easier on the machine, but either way works
Hi @Scrumbled
Here's two ways, one with regex and one with the text to columns tools:
Below is the regex I used, although there are definitely a number of ways to do it.
(.*),\s([[:alpha:]]+).*
I know this can be done using text to columns, but I was looking for a solution with fewer steps/tools--even though regex may be computationally more taxing.
Thanks to both of the respondents!