Hi,
I've got data that reads like this:
YY_BREAKFAST_FOODS_CAT_AB_SFF_PROD
YY_ICE_CREAM_CAT_AB_SFF_PROD
I want to parse the strings to output:
BREAKFAST_FOODS
ICE_CREAM
Pls can you help me? Thanks.
Solved! Go to Solution.
Hi @chc10 I mocked up a workflow using regex. Let me know what you think?
Perfect thank you!
Hi @chc10,
I've adjusted the Regex in Josephs example however it still won't quite work for all your examples as the structure varies in the total rows. So it would need further work in that case.
I also included a non-regex example that you could use instead if that helps.
This approach uses a match to replace values before and after the bit you want to keep, the downside vs. regex is that you have to specify the match values, where as regex doesn't care what the values are as long as they match the structure. You also have to be mindful of the order in which it replaces values with this method.
Regards,
Ben
Hi @chc10 I amended the workflow to work for that example of data. With regex you need to match it to the pattern in your string. For that example in the data you supplied there where three patterns. If new patterns occur then you need to amend the regex for it. If you not familiar with regex would recommend the Parsing Data lessons on the community.