Text Parsing Help Please!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you so much!!!
