I need to read multiple file paths from an excel and delete files which are more than 30 days
Welcome to the UiPath Community
Need more information about the 30 days, whether it is Creation Time or Last Write Time.
In order to know the age of file (from creation time) use this
(Now-File.GetCreationTime("C:\TestFolder\image.png")).Days
you have to replace the path with path of your file
Suppose your excel file contains data like below
You can design the work flow like below
For your reference
read multiple file paths from an excel and delete files which are more than 30 days.xaml (6.5 KB)
The file paths are incomplete. The extension of files are missing. Shift + right click on the file and then select copy as path option and then paste the path in excel.
Clarify if the excel contains folder path or file path.
Also, the topic you created gives information that the excel contains only file path. Change the topic title and description accordingly.
For the input excel file like below
Check the updated xaml file
read multiple file paths from an excel and delete files which are more than 30 days.xaml (8.7 KB)
This can further be optimized by using the root directory path which contains all the folders. For that I would suggest to explore the Directory.GetFiles()
method.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.