Hello guys, I have a folder with multiple files and I want to select all files except the one modified today to move them to another folder.
Anyone have any idea how can I do this?
Thank you!
Hello guys, I have a folder with multiple files and I want to select all files except the one modified today to move them to another folder.
first you have to create variable with DirectoryInfo type Ex : Folder
then you have to create a variable with Array of FileInfo type Ex: OlderFiles
put the below syntax in Assign activity
Folder = new DirectoryInfo(“your source folder”)
OlderFiles = Folder.GetFiles("*.csv").Where(function(file) file.LastWriteTime.Date<>DateTime.Now.Date).OrderByDescending(function(d) d.LastWriteTimeUtc).ToArray
OlderFiles variables hold all the csv files except today file
use for each activity to iterate and pass in value as Older files
Put move file activity inside the for each activity and select destination folder in to tab , enter item.Fullname in from tab
Hope it solves your issue
Update as whether you got a desired Solution or not
thanks
Robin
It worked!
Thank you very much, I appreciate!
Best regards,
Ionut
Your Welcome
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.