Hi, Alteryx Community!
I need to parse out the string that starts with "USD" from below. Any ideas on how to do that using Parse Tool? Thank you so much for your help in advance!!!!
Original String:
ABC EFG 1234 56 1A USDAAA 12345
ABC EFG 1234 56 1A USDBBB 12345
Need to Parse:
USDAAA
USDBBB
Solved! Go to Solution.
@kkkim ,
In your example (above) the USDAAA is always the same length and in the same position.... so you could use a substring() function in a formula as:
Substring([String Field],19,6)
If the field is "flexible" (length = 6), you could use a formula like:
Substring([String Field], Findstring([String Field], "USD"),6)
or you could play with a Regular Expression as:
Regex_Replace([String Field], ".*\s(USD\w+)\s.*",'$1')
The RegEx is most flexible, but hardest to explain to your boss. it finds a group of letters/numbers preceded by USD until the following space.
Cheers,
Mark
P.S. I didn't test these formulas. They might need a little TLC.
Thank you so much!!!