Is there a way to find the last occurrence in a string of a character?
For instance, if I want to get the file part of a file path (/a/b/c/file.txt), how can I extract that?
Last Occurrence in String
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 39
- Joined: Tue Apr 15, 2014 9:14 am
I assume you don't want to do this via regex but in a transform stage, correct? The following derivation
will give you the last substring delimited by a '/'.
Code: Select all
FIELD(In.StringColumn,'/',DCOUNT(In.StringColumn,'/'))
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: