I'm working with data that has suffix strings of variable length that I need to remove to get at my core data string. I know the list of suffixes I need to remove. My challenges are, the core strings I need to keep are of varying length, spaces, etc, the suffixes I need to trim are around 100 and of varying length and spacing, and periodically new suffixes will be added to the existing list to trim. My only solution right now is to run a chain of 100 separate Formula or Multi-Filed tools to remove each string individually, and add new ones when I encounter new suffixes. This is obviously far too cumbersome to set up and manage. Can anyone suggest a more elegant way to trim all of these suffixes?
Sample of the data I'm working with:
| Initial Data | Data I Need |
| CORE STRING TO KEEP1 TRIM1 | CORE STRING TO KEEP1 |
| CORE STRING TO KEEP22 TRIM2 xx | CORE STRING TO KEEP22 |
| CORE STRING TO KEEP333 TRIM3 yy y | CORE STRING TO KEEP333 |
| CORE STRING TO KEEP4444 TRIM4 Z | CORE STRING TO KEEP4444 |
| CORE STRING TO KEEP55555 ALSO KEEP1 | CORE STRING TO KEEP55555 ALSO KEEP1 |
| CORE STRING TO KEEP666666 ALSO KEEP2 | CORE STRING TO KEEP666666 ALSO KEEP22 |
Solved! Go to Solution.
@Rob48 If there's a pattern to what you need to trim/keep then you might be able to do this with a RegEx. Based on your example above, the following would work with the RegEx tool in parse mode:
(.*KEEP\d+)
Which will keep everything up to the final KEEP and its attached numbers

