How to discard the last few words from concatenated string
- 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
I looking for solution to discard the last three words from concatenated string. The string length is dynamic and gets generated based on excel file input.
For Eg.
abc|def|acd|cf78c|bn12mn
Exclude -acd|cf78c|bn12mn from above string
- Labels:
- Data Investigation
- Developer Tools
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Are the words always going to be separated by pipes so that essentially you need to remove everything from the third-to-last-pipe on?
- 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
If you use a Text to Columns and set the delimiter to PIPE, you can set the # of output columns to 2 and discard the remaining contents. Alternatively..
REGEX_Replace([Field1], "(.+)\|.+\|.+\|.+", '$1')
Cheers,
Mark
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
Yes the string is always separated with pipe | and it should exclude the last three words and return remining string.
Exclude -acd|cf78c|bn12mn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Have you tried my solution or @MarqueeCrew solution's?
If this solves your issue please mark the answer as correct, it will help others!
Regards,
