Alteryx Designer Desktop Discussions

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

Remove large part of string up to first '+' character

JamesEffix
7 - Meteor

Hi,

 

I have a source file from which a certain colomn needs to be cleaned.

 

The strings in that column are composed as follows <string part a> + <string part b> + <string part c>.

part b and c have little variation and is section I'm interested in. That needs to be written to an SQL database, for further processing

 

How can I remove the first part of the string, including the '+' character and store it cleanly in the database. 'Part a' has a lot of variation. So it has to remove all before and including the first + (there can be more, so it has to be the first one). Can this be solved with a certain RegEx - formula?

thanks for your time and assistance.

regards

James Effix

5 REPLIES 5
jdunkerley79
ACE Emeritus
ACE Emeritus

The REGEX bellow will parse the string you sent:

 

([^+]+)\+?(.*)

The first part ($1) will be up to the first +. If no + then it will return the whole of the string in $1.

$2 will contain the rest of the string after the +.

 

The easiest tool to use for this is a REGEX tool in parse mode which will add 2 new columns

 

Sample attached

JamesEffix
7 - Meteor

Thanks this is exactly what I needed.

paul_houghton
12 - Quasar

I'm just wondering if you could use the normal text to columns tool with + as the delimiter to make it simpler still?

jdunkerley79
ACE Emeritus
ACE Emeritus

Yep would work fine (though Regex more flexible :))

 

2016-11-09_10-02-35.jpg

jdunkerley79
ACE Emeritus
ACE Emeritus

 

Duplicate Post Deleted

Labels