I would suggest you start with the function List Directory Recursive that you can get from
OpenG. Download and install the OpenG Commander to get the entire package. The function will return an array of paths to files in your folders and sub-folders. You can even specify a pattern so that it will return a list of only *.txt files. Once you have the list, you can open each file in a loop and do your searching with the the file I/O and string functions.
One thing to keep in mind for the future is that instead of separate text files, a database can handle this type of task much more effectively. You've got a couple of queries that could be performed in seconds (or minutes at the outside) but with text files, you'll have to open each one, read the data, and then search through the file for the information. If by MANY files, you mean tens of thousands, then 30 minutes might be optimistic.