Alteryx Designer Desktop Discussions

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

How to Trim the string data and paste in different columns based on a specific rule?

madhurinani
8 - Asteroid

Hello All,

I have the data in below format:

 

Column 1Column 2
test 1Name: abc, brand: kia, type: EV, color: blue
test 2Name: xyz, brand: bmw, type: EV, color: white
test 3Name: qwe, brand:audi, type:gas, color: red

 

I would like the output as follows:

Column 1Namebrandtypecolor
test 1abckiaEVblue

 

Some of the column headers might not have the colon(:) and might just be "Name abc". For this I think I might need to create a specific rule for that.

 

Is that something that can be achieved in Alteryx?

Any help would be appreciated.

 

Thanks! 

22 REPLIES 22
ShankerV
17 - Castor

Hi @madhurinani 

 

We can achieve the solution in 2 ways.

 

1. Using Regex tool.

2. Using Text to Columns tool and using formula to find and replace.

 

Many thanks

Shanker V

Luke_C
17 - Castor

Hi @madhurinani 

 

Here's one way with the text to columns tools:

Luke_C_0-1671565027697.png

 

 

ShankerV
17 - Castor

Hi @madhurinani 

 

solution 2:

ShankerV_0-1671565251235.png

 

Input with colon and without colon

ShankerV_0-1671565396674.png

 

Note: The workflow used to achieve the solution is attached which can be downloaded to see how the solution works.

 

If you believe your problem has been resolved. Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

 

Felipe_Ribeir0
16 - Nebula

Hi @madhurinani 

 

One way of doing this

 

Felipe_Ribeir0_0-1671565581338.png

 

madhurinani
8 - Asteroid

@Luke_C : I might not have all the column headers with colon (:)

Example:

I modified the example as below. Removed the column from brand kia

madhurinani_0-1671566498358.png

 

And once I run the workflow, somehow the data is incorrectly formatted as below

madhurinani_1-1671566553860.png

 

 

Do you know how can this issue be fixed?

 

Thanks

madhurinani
8 - Asteroid

@ShankerV : Based on my understanding, the workflow is not dynamic. 

If the i/p file has an additional column, then I would have to manually Text Input and the column header name as well for the workflow to get all the column header populated in the o/p file

 

Do you know how I can fix that issue?

 

Thanks!

ShankerV
17 - Castor

Hi @madhurinani 

 

Yes, we can make it dynamic. 

ShankerV
17 - Castor

@madhurinani 

 

Please find the dynamic way to reach the solution.

 

ShankerV_0-1671567229593.png

 

Input with and without colon

ShankerV_0-1671567504775.png

 

Note: The workflow used to achieve the solution is attached which can be downloaded to see how the solution works.

 

If you believe your problem has been resolved. Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

binuacs
20 - Arcturus

@madhurinani One way of doing this 

binuacs_0-1671567557174.png

 

Labels