I have a directory which contains multiple files in it.
I want to read the file only once.
i.e if There are files from 1 to 50 in the directory and in the first run the files upto 20 are processed, in the next run i don’t want to repeat those same files that is from 21 onward.
Any idea?
An idea is to write the filenames into a datatable. Write those to an excel. On the next run, read the excel to a datatable and then compare the filename to the datatable, if the filename is already in the datatable then it will not be processed.
hi,
you can move file to another location/folder once you processed, so from the next run the processed files will not be available in the input location.
@ray_sha Besides both of the approach mentioned by @avejr748 and @shaikmdrafi you can have a copy of processed file in some temp folder and for every item and run check.
If file is already exists in temp then skip it and get the next file.
@ray_sha create a new folder in your local project and for each file check if file is already exists in that folder if not then create a copy of processing file inside otherwise skip
@ray_sha you just need to check if a file which you picked up next exists in that folder or not so your if condition would be File.exists(tempfolderpath+path.getfilename(nextdilepath))
If true then skip otherwise process the file and also make a copy into tempfolder
Hey,
Say there are a total of 50 sub folders in the main file and in that first run 10 of which are processed.
The bot may be stopped of some reason.
Now in the second run, those 10 sub folders which were processed shouldn’t be processed again, the bot must continue from the 11th sub folder.