How to extract the text into two columns?

I want to extract the text before dash in sku
How can i do it?

For example:
The original sku is AA12345-XA01.
I want to split into two columns, one is AA12345- (Need to keep dash in the first column.), the other is XA01.

It may not be the most efficient way but works for me.

Find and replace - with --, then text extract all text after last instance of - and all text before last instance of -

2 Likes

@THOMAS_A_HUSMANN I like your solution! That would work.

Another option would be to use the Split Column step, using the delimiter -

Once you have the two parts of your SKU in separate columns, you can use the Insert Column step to merge - back into the first part of your SKU. Instead of the {email} column, make sure to replace with your column name.


3 Likes

Hi Thomas,

Thanks for your reply.
This method solved my problem. Thanks for help! :grinning:

2 Likes

Hi sachi,

Thanks for sharing another solution.
However some of our sku don’t need to keep dash, but some need.
Unfortunately, there is no way to completely solve this problem.
But this is still a good way, maybe we can apply it in other situations.
Thanks again for your kindly sharing. :blush:

2 Likes