Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Regex – Parse one column with different values delimited by a comma

filiptoporek
5 - Atom

Hello Community!

 

Looking for help with Regex expression.

 

I tried to figure out how to parse one column with three values delimited by a comma and mixed in each row.

 

Example:

ProductDescription
OneMeasures:10/10/10, Material: Steel, Color: Black
TwoMaterial: Steel, Measures:10/10/10, Color: Black
ThreeColor: Black, Measures:10/10/10, Material: Steel
FourMeasures:10/10/10, Material: Steel, Color: Black
FiveMaterial: Steel, Measures:10/10/10, Color: Black
SixColor: Black, Measures:10/10/10, Material: Steel
SevenMeasures:10/10/10, Material: Steel, Color: Black
EightMaterial: Steel, Measures:10/10/10, Color: Black
NineColor: Black, Measures:10/10/10, Material: Steel
TenMeasures:10/10/10, Material: Steel, Color: Black

 

What I want:

ProductDescriptionMeasuresMaterialColour
OneMeasures:10/10/10, Material: Steel, Color: Black10/10/10SteelBlack
TwoMaterial: Steel, Measures:10/10/10, Color: Black10/10/10SteelBlack
ThreeColor: Black, Measures:10/10/10, Material: Steel10/10/10SteelBlack
FourMeasures:10/10/10, Material: Steel, Color: Black10/10/10SteelBlack
FiveMaterial: Steel, Measures:10/10/10, Color: Black10/10/10SteelBlack
SixColor: Black, Measures:10/10/10, Material: Steel10/10/10SteelBlack
SevenMeasures:10/10/10, Material: Steel, Color: Black10/10/10SteelBlack
EightMaterial: Steel, Measures:10/10/10, Color: Black10/10/10SteelBlack
NineColor: Black, Measures:10/10/10, Material: Steel10/10/10SteelBlack
TenMeasures:10/10/10, Material: Steel, Color: Black10/10/10SteelBlack

 

If you need more information please let me know. Thanks a lot for any hints or solutions.

6 REPLIES 6
TimN
13 - Pulsar

Here's an attempt.

 

Tim 

Qiu
21 - Polaris
21 - Polaris

@filiptoporek 
We can use two Text to Column tools like below

1210-filiptoporek.PNG

PanPP
Alteryx Alumni (Retired)

The attached workflow uses text to columns, but you can use regex if you prefer.

flying008
14 - Magnetar

Hi, @filiptoporek 

 

If you want use RegEx function to get :

 

录制_2022_12_10_10_31_31_191.gif

ShankerV
17 - Castor

Hi @filiptoporek 

 

Please find one way of reaching the solution for your expected output.

 

ShankerV_0-1670651882762.png

ShankerV_0-1670651712820.png

Hope your issue is resolved. Feel free to mark helpful answers as a solution, so that future users with the same issue can find them easier!!!!

 

Many thanks

Shanker V

filiptoporek
5 - Atom

Hello,

 

many thanks for all your response. All of your solutions are helpful and work properly.

 

In general, my real example is more complicated, but I used a solution written by @Qiu 

 

Best regards,

Filip

Labels