Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Text to Column

dhakim1996
8 - Asteroid

Hi I want to split the column using delimiter "-". e.g. "ABC - Do not use" it will be split into "ABC" and "Do not use". However there are some where "-" is part of their name e.g. "A-BC". Using the text-to-column function it will split into "A" and "BC" instead of keeping it. Anyways to solve this?

 

Thaank you!

4 REPLIES 4
DataNath
17 - Castor
17 - Castor

@dhakim1996 are the records always in that similar format of [1] - [2] where there aren't spaces in [1], but could be extra hyphens? I'm just thinking the following could perhaps be an alternative if so:

 

DataNath_0-1659002443286.png

 

If not, can you provide a list of some further examples? I think RegEx is the way to go here so will just need a few possibilities to work with to try and build out a suitable expression.

Nick-C
Alteryx
Alteryx

Hey @dhakim1996
Are you confident that the second half of the "Input" won't contain your delimiter? If so then you could use ReverseString to flip it around and parse using "-" and then ReverseString it back the right way again! 

If the second half of your string might also contain the Delimiter then this won't work but just a thought! 

 

NickC_0-1659005773604.png

 

Kinga
8 - Asteroid

If in the second part the is no "-" I would use RegEx Tool and in pattern add "$" as end of line:

 

Kinga_1-1659007870433.png

 

Emmanuel_G
13 - Pulsar

Hi @dhakim1996 ,

 

Find attached one easy way to do this with regex tool.

Emmanuel_G_0-1659040878523.png

 

Labels
Top Solution Authors