Hi everyone i want to read multiple files from one folder and i am using for each file loop to read excel files,what should i do so that everyday whenever it loops the folder files it should not read the already processed file. i am not using any database currently i just want that setting to be done in the work flow.
Thanx
regards
1 Like
You can get the present day files into the loop.
Today’sFiles = Directory.GetFiles(“path_to_directory”).Where(x => new FileInfo(x).CreationTime.Date == DateTime.Today.Date);`
Hi @vvaidya thanx alot but what if i run the robot again multiple times a day ??
is there something like setting flag similar to database??
-
you can write the file names to a text file/excel and filter them out during next run.
-
rename the file to abc.txt to abc_read.txt
-
get files created after last run by storing last run time in a file (when cycle ended)
@nara var files = directory.GetFiles()
.Where(file=>file.LastWriteTime >= from_date);
2 Likes
I suggest to try KrojamSoft BatchRename