Starting from:
$30

$24

Closed Lab 4 grep Solution

Description: grep is a Unix/Linux command line tool that scans les for a target string. The output consists of the lename and the contents of the line for every occurrence of the target string. The -n ag 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 implemen-tation will scan all of the les in a provided directory of les for a target string entered by the user. It will behave as described above for grep -n. Your program should nd 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 le you downloaded contains the directory of les your program should scan as well as a python le to get you started.












































































1

More products