In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
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