Starting from:

$27

Closed Lab 4- grep


Description: grep is a Unix/Linux command line tool that scans files for a target string.
The output consists of the filename and the contents of the line for every occurrence
of the target string. The -n flag to grep causes it to report the line number for each
occurrence in addition to the information above.
For this assignment, you will implement a version of grep in Python. Your implementation will scan all of the files in a provided directory of files for a target string entered
by the user. It will behave as described above for grep -n. Your program should find
the string independent of upper or lower case. An example output line searching for
‘Lab’ will look like this:
cl04.tex: 42: This lab assignment is awesome.
Your program should identify the same line if the user enters any of the following
strings: ‘LAB’, ‘lab’, ’lAb’, ‘lAB’, ‘LaB’, ‘LAb’, ‘Lab’, laB’.
Details: The zip file you downloaded contains the directory of files your program should
scan as well as a python file to get you started.
1

More products