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.

pull out STATE REGEX

hi2019
8 - Asteroid

Hi

 

I am currently puling out year but I need to pull out year and STATE From in put file to populate as filename for output

 

REGEX_Replace([FileName], "([0-9]{4,}).*",'$1')  this is only pullig for year

 

 

current input name looks like this

2024 TX Auto 400005 Working File Input.xlsx

 

output for filename should be

2024 TX Auto 400005 Working File output

 

thanks

2 REPLIES 2
DataNath
17 - Castor
17 - Castor

Hey @hi2019, if this format is consistent then a slight modification in adding '\s\w{2}' i.e. space then 2 word characters should do the trick. If the pattern can change and/or there are edge cases then please let us know:

 

REGEX_Replace([FileName], "([0-9]{4,}\s\w{2}).*",'$1')
cjaneczko
13 - Pulsar

Could you just bring the file name in as a field and replace the 'Input.xlsx' with 'output'?

Labels