James Ferree wrote:
Hi,

I am looking to write a script that will look in a
file for a list of text strings to search for like

req_aaaa
req_bbb
req_ccc

and search all the files in a subdirectory and below
for the string, if it is found, then it prints out the
the original string followed by the file name for each
instance where it is found.  If it gets through all
the files and finds none, the it prints out the
original string and the Words NOT FOUND.

Thanks for any help,
Jim


quiet a simple problem
why dont u try the code yourself

the algo may run like this
write a function to get all filenames with respect to current directory into an array
write a function that accepts a filename and returns the the lines that match your string
foreach of the array run the function and print the output



but IMHO doing this in perl does not seem to be the best option If you are using unix like system just try getting grep


Your entire script is over in just one line ` grep -r "$string" * `



Bye Ram










-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to