Create a program that will search through all the files in a directory and throu
ID: 3566259 • Letter: C
Question
Create a program that will search through all the files in a directory and through all files in subdirectories recursively. The program will search each file for a given string and will report the number of lines that contain that string. Command line parameters will be used to specify the directory and the string.
So, for example, if the command line parameters are
mysteries Holmes
then the program would search recursively through the directory mysteries and all its subdirectories counting the number of lines in all files that contain the string Holmes.
Note that the string being used as the search key may be part of a larger word. For example, if the key were ear, then it would be found in the previous lines as part of the larger word search.
If a string appears multiple times on a line, that line is only counted once.
You should have a recursive method in the program that returns the count.1 It
Explanation / Answer
Python code
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.