Reading a string left to right
- 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,
I have a field titled "File Path Name" with values in the following format:
map/file/Delta Hospital
map/file/HSC/Alpha Hospital
screen/file/HSC/Omega Hospital
map/Sigma Hospital
I want to pull all characters (Hospital Names) to the right of the last "/" or essentially all characters from the end of the string up until the last "/". The problem is there are a different amount of "/" in every record, but the Hospital Name is always at the end of the string. Is there a way to read the string from right to left and find that first "/" and pull those characters?
Thank you for your help!
Solved! Go to Solution.
- Labels:
- Regex
- Transformation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @mattpwc ,
I'm attaching an example where I use the regex tool to get that.
Take a look and let me know if this works for you.
Best,
Fernando Vizcaino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @mattpwc ,
a solution doing literally what you've written, would be to use the function ReverseString, which reverses a string, FindString to find the last "/" (which is the first in the reversed string) and Right to pull the characters after the separator. As (nearly) always, there are different ways to solve a problem using Alteryx. Hope, this is helpful.
Best,
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Works great thank you for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!
