Hi Alteryx Community! I am trying to extract names from data that also includes information that I do not need, which is located to the left and right of the full name. As evidenced below:
Customer Name: JAMES SMITHS Vehicle Number: 12345678
I would like to have the output extract, "FIRSTNAME LASTNAME" and remove all other information.
I have tried REGEX, Left() and Right(), but I cannot seem to find the solution. Any help would be greatly appreciated!
Solved! Go to Solution.
Hi @StrategyMan
If your data is always of this form then this expression in a Regex Parse tool with output method set to Parse should work for you
.*?\s{2,}(.*?)\s{2,}
Break down
.*? any number of characters non-greedy
\s{2,} 2 or more consecutive spaces
(.*?) any number of characters non-greedy. this is only marked group so it will show up in the output
\s{2,} 2 or more consecutive spaces
Dan
Looks like you could also use the GetWord() function,
@PhillipMannering and @danilang thank you both for the solutions.
They both worked and were instrumental in getting this solved.
Much obliged!