file grep

cyberdevil

New Member
i would like to forfill a "file-grep" in progress

for instance:

i have a string (for instance: "test")
now i want to show all the programmes in a particular directory (c:\temp) who contains that certain string.
how do i program in progress such a file-grep?


greetz
 
What you ask is actually quite tricky. You need to know a few things in order to do this correctly. For example:

1. How to read directory contents
2. How to tell if a file is a directory
3. How to use recursion (to process sub-directories)
4. How to read the contents of a text file line by line
5. How to examine each line for one or more occurances of a string

plus a lot of other stuff!

Please find attached a couple of programs that show how it is done. The .w file is the sample caller program. The real work is done in the .p.

HTH
 

Attachments

Back
Top