Hi Experts,
I'm looking for a function that would do the following.
Loop thru all files of a given folder.
Search for files containing some wording in their name "PatMed" for example.
All files are ".txt"
and look for PatientID = 123.
Function should return the entire record
If found more than one, should return all
This should be in order of file created.
If possible, to include in each row, the date/time of file created.
So function should Receive 4 parameters (FolderName, FileName, FieldName, Criteria)
and should either create a file with results, or just return a text delimited string.
Sample of file attached.
PS. Would prefer VBA function.
Thanks
Untitled.png
Let me give you a quick start-
Refer FileSystemObject-https://www.tutorialspoint.com/vbscript/vbscript_fso_objects.htm
Open in new window
Now, you just need to loop through all files in the folder.