Alteryx Designer Desktop Discussions

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

Picking up latest file from directory of multiple files

srk0609
8 - Asteroid

Hi,

 

I want to pick up latest file from this folder having multiple files. I want to pick latest file starting with Sophis name. There would be latest file everyday. srk0609_0-1655936807350.pngCould someone help me with this? In 06172022 06 is Month 17 is Day 2022 is Year. Thank you.

 

1 REPLY 1
DavidSta
Alteryx
Alteryx

Hi @srk0609,

 

you can achieve this with a combination of Directory Tool, some Prep&Blend steps and - if you want to read the file as well - with a Dynamic Input.

 

DavidSta_0-1656000063664.png

At first you read in the whole directory where the files are stored.

Then you extract the date out of the filename. I have done this in the RegEx step where I am looking for 8 numbers before the file extension XLSX.

I use this extracted information to make a date with the DateTime Tool before sorting it and filtering to the latest file.

 

See a sample Workflow attached.

 

Now you could use the whole file path in combination with the Dynamic Input to read the content of the file as well.

 

Hope this helps.

 

Best regards,

David

Labels