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

How to extract a specific string into a separate column?

synergy825
8 - Asteroid

Hi,

 

What is the best way to extract the "0018" into a separate column? The 4 digits are in string format.

 

CORPORATE*GLOBALGR&PP - Dept # 0018 - 195500432069

 

I initially tried to do a text to column approaching using the delimiter " - ", but some values within the field had more than 2 delimiters.  I am assuming that the best way is to use the RegEx tool, but I'm not quite sure what the expression is and how to configure it to achieve my desired result.  Can anyone please assist?  Thank you!

 

2 REPLIES 2
ed_hayter
12 - Quasar

Regex - with parse setting:

pattern:

.*#\s(\d{4}).*

assumes that the code is always 4 digits that follow # space

 

regex101.png

synergy825
8 - Asteroid

Thank you @ed_hayter !

Labels