Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Extract numbers/Special characters from a string value

Cfdiaz2103
8 - Asteroid

Hi everyone!

 

Is there any way to take numbers or special characters from a record?

 

For example:

Input Data:

Column A
Tax Discount 9/100
Carlos 14.5/100 Miami

 

Output Data:

 

Column AOutput Column A
Tax Discount 9/1009/100
Carlos 14.5/100 Miami14.5/100

 

Thanks for your response.

6 REPLIES 6
apathetichell
19 - Altair

try this one.

 

If it's always number/number there are easier ways so I wasn't sure of the complexity of what you are looking for. Takes any special character/number or period in a row and tokenizes them. If the resulting field is empty (ie a string of spaces) it will filter them out.  it filters out standalone punctuation by then searching for only strings that contain at least number.

mceleavey
17 - Castor
17 - Castor

Hi @Cfdiaz2103 ,

 

I've built a little regex magic:

 

([^a-z\s]+)

 

mceleavey_0-1620667134207.png

 

M.

 



Bulien

Cfdiaz2103
8 - Asteroid

Hi @mceleavey !

 

You nailed it, bro!

 

Thanks in advance.

mceleavey
17 - Castor
17 - Castor

no problem.gif



Bulien

Cfdiaz2103
8 - Asteroid

@apathetichell That was cool. It perfectly worked!

 

Thanks!

apathetichell
19 - Altair

Good to hear - but @mceleavey 's solution was definitely more awesome. Regex tokenize based upon non-matching was definitely the way to go.

Labels