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.

Extract numbers from string (before the 1st character)

goutdelete
8 - Asteroid

 

Hi,

 

I have a text field with address so the data is something like the table below.  Since everyone may enter the data differently, I need to do some data cleansing and the first step is to parse (extract) all the numbers before the first alphabet character (i.e. if there is any special characters such as ", - or &", I would need to keep them together and only stop right before the first alphabet (a to z).  I tried a different ways but just didn't seem to work out for me.  Thanks!

 

Text
1158 MON S
45 RIM C
12950 210 S
3442 LOY D
140 Lar R
377, 7000 AL
266, 40 TA
144 WAL S
2211 De L'
355 Sav R
2449 DE LAG
1 PIN SP
69 Car R
8, 141 SI
41 Win W
223 SPR R
108 MAR P
11 34 
228 Ran D
601 And A
1 REPLY 1
apathetichell
19 - Altair

regex_replace([Text],"^(\U+)\s(\w+)(.*)","$1") - in a new formula tool/new column. you'll probably have more issues with the next part.

Labels