Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

RegEx help

bsanders2009
8 - Asteroid

I am still a fairly basic Regex user but appreciate the power it brings to data parsing.  I'm stuck on parsing a pipe delineated series of numbers to return the first three results that start with a non-zero number.

 

For example, I have:

0|0|7|0|1|0|0|3|5|7|1|3
1|0|6|5|1|0|0|7|1|2|0|5

0|0|0|3|0|6|0|3|3|3|6|3

 

I want the following:

Value1Value2Value3
701
106
306

 

Any help would be greatly appreciated!

 

EDIT:  Note that my example above happened to have all single-digit numbers, but numbers between pipes can be double digit as well.

4 REPLIES 4
Felipe_Ribeir0
16 - Nebula

Hi @bsanders2009 

 

If i got the right understanding about the problem, the attached workflow will do the job.

 

INPUT:

 

INPUT.png

 

OUTPUT:

 

OUPUT.png

DanielG
12 - Quasar

@bsanders2009  - i did one here without Regex, but using the Text to Columns within the Parsing Tool selections.

delimiterhelp.png

 Slightly different than @Felipe_Ribeir0 but they both give you some options.  That's the great thing about Alteryx there's 100 ways to do the same thing.  :)

PhilipMannering
16 - Nebula
16 - Nebula

Here's the Regex approach,

 
However the two approaches above are better.
 
RegexRegex
 
P
bsanders2009
8 - Asteroid

Love this community.  Thanks everyone!  I learned a lot from the different solutions today.  Much appreciated!

Labels
Top Solution Authors