I have multiple text files that are generated everyday.
I would like to search "apple" string from the latest modified text file. If the string is not found, i will need to search from yesterday's text file. If it still not found, i will need to search from day before yesterday's text file. The process keep going until i find the string.
Take an example:
Text file created today named : 08112018.txt
Text file created yesterday named : 08102018.txt
Text file created day before yesterday named : 08192018.txt
I will start my search for "apple" in 08112018.txt first. If it's not found, i will search "apple" in 08102018.txt. The process continues until "apple" is found.
Here's what I think will give you the best result:
Start by listing all your files into a disconnected record set:
You can then sort those by date last modified:
Now you can start from the top of the list and work your way through.