in reply to Reading a Directory of Files, Searching for Text, Outputting Matches
The example shown in Re: Read entire file from given folder is the basic skeleton I use for this sort of thing, and may give you some ideas.
HTH,