In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to retreive newest file from a directory

TysonSri
6 - Meteoroid

I am looking for a newest file from the directory. 

 

Directory : C:\Documents\Files

 

In the above directory there are multiple files like below.

 

123_test_data20220830abc.csv

234_test_data20220829abd.csv

345_test_data20220828bcd.csv

 

From the above files I need to retrieve the latest (today's file).

 

Can you please let me know how do we do that..?

3 REPLIES 3
Luke_C
17 - Castor
17 - Castor

Hi @TysonSri 

 

Are you able to rely on any of the date time fields the directory tool outputs? If so, just sort the files based on the relevant field and use a sample tool to take the first record. 

Luke_C_0-1661875595179.png

 

TysonSri
6 - Meteoroid

Thank you solution.

I want to populate data from latest file 

 

Using sorting option i managed to get latest file  now how to populate/import  data from the  latest file as output 

 

TysonSri_0-1661880952765.png

 

Thank you 

Luke_C
17 - Castor
17 - Castor

You could use a dynamic input tool or batch macro to do that. There's lots of documentation on that in the community, but if you provide a sample file I could mock it up.

Labels
Top Solution Authors