thanks for the reply john. I know, it is quite easy to do with recursion and File:FInd, but as i said, it was an assignment might be they are checking my capability.
what do yo say, if we do a grep in the directory and stack the list and then taking the directory and processing the file.