Hi Team,
I want to pick up the latest file from the folder where all files are same just the dates are changing. I tried using the directory tool with wildcard but it is picking all the file. Can someone please guide how to do it?
Solved! Go to Solution.
hi @SudhaGupta1 directory tool would be the best you can use the sort tool on the file/folder created date field to get the leates file in the directory alternatively if you could provide the file naming convention im sure we could parse out the dates and then sort the data that way also to ensure you are only processing the latest file or a file that meets a set conditon
Use the directory tool to bring in details of all files, then sort by date and use a sample tool to select only the latest.
@Christina_H Thanks for helping out. It worked.
How do I pull the actual file CONTENTS forward for further processing? I tried to follow these steps and I'm just left with a dataset showing the filename, creation time, a record ID, and the newly added column of "Record_Status". I need to have the latest file then opened and further filtered and transformed.
RecordID | FileName | CreationTime | Record_Status |
1 | 20230401 example.txt | 4/1/2023 2:53 | latest file |
2 | 20230201 example.txt | 3/1/2023 13:13 | old file |
3 | 20230301 example.txt | 3/1/2023 13:13 | old file |
4 | 20221201 example.txt | 12/1/2022 3:25 | old file |
5 | 20221101 example.txt | 11/1/2022 8:47 | old file |