Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

Parse Date From File Title

jenner85
8 - Asteroid

 

Hi - I am terrible with regex and need to  be able to pull the date out of all of these file names, can anyone help me please? I then need to turn it into first of the month format (2022-04-01). Thanks!

 

 

Rewards Merchandise APR2022_Report.csv
Choice Rewards Merchandise May2022_Report.csv
Rewards Merchandise May2022_Report.csv
Rewards Merchandise O May2022_Report.csv
Choice Rewards Merchandise Jun2022_Report.csv
Choice Rewards Merchandise_O_Jun2022_Report.csv
Rewards Merchandise Jun2022_Report.csv
Choice Rewards Merchandise Jul2022_Report.csv
Rewards Merchandise_O_Jul2022_Report.csv
Choice Rewards Merchandise AUG2022_CI-0000015127 Report.csv
Rewards Merchandise AUG2022_CI-0000015124 Report.csv
Choice Rewards Merchandise SEP2022 Report.csv
Rewards Merchandise SEP2022 Report.csv
Rewards Merchandise SEP2022_Report.csv
Choice Rewards Merchandise OCT2022_CI-0000015810_Report.csv

6 REPLIES 6
MilindG
12 - Quasar

MilindG_0-1682606854583.png

 

FinnCharlton
13 - Pulsar

@jenner85 , You can add one more tool to get the date in the format you want:

FinnCharlton_0-1682607063173.png

 

DataNath
17 - Castor
17 - Castor

@jenner85 here's one way you could go about it - just looks for a pattern of 3 letters followed by 4 digits immediately and then dateparses it:

 

DataNath_0-1682607158535.png

 

If you'll ever have extra parts of your file names that may throw this off let us know as it'll probably require a more nuanced approach.

Pranay18
6 - Meteoroid

Add RegEx Tool with the Formula :

 

Pranay18_0-1682608376851.png

Add formula Tool and add a new column - Date :

Pranay18_2-1682608488555.png

 

Pranay18_1-1682608441138.png

 

 

jenner85
8 - Asteroid

Can you help parse the date out of this format please? 

CPP_8549CONS_TDMBNAConsumer-20220501.xlsx

Pranay18
6 - Meteoroid

 

Hi Jenner,

 

Please see the solution below:

Pranay18_1-1683119960507.png

 

Labels
Top Solution Authors