Question: Project #6 Perl This assignment has two parts. Each part must be done using Perl. Part A find.pl Create the script find.pl which searches for

 Project #6 Perl This assignment has two parts. Each part must

be done using Perl. Part A find.pl Create the script find.pl which

searches for files in a directory list based on a regular expression

Project #6 Perl This assignment has two parts. Each part must be done using Perl. Part A find.pl Create the script find.pl which searches for files in a directory list based on a regular expression pattern: If the file name matches, print that file name. If the file name doesn't match, it should look for instances of the regular expression within the text of the file. If found, it should print the filename, a colon, and the text for the first line that contained that pattern. If the -i option is passed, the script should return the opposite files (i.e., those which do not match the expression in file name or contents). The script should be invoked with the following format: find.pl -i perlRegexpPattern ListofFiles where -i is optional Example data is at the bottom of this page For part A, copy those into a directory named "Da" Example: For a directory, Data containing the following files: input.txt proiPerl1.input proiZ.cproiz.h Assuming input.txt contains the following text: proji.c proj1.012.c proj12.c projPerl1.pl trash.txt Hello World This is input for proji Test data find.pl should behave in the following way (the order of the files is insignificant): Project #6 Perl This assignment has two parts. Each part must be done using Perl. Part A find.pl Create the script find.pl which searches for files in a directory list based on a regular expression pattern: If the file name matches, print that file name. If the file name doesn't match, it should look for instances of the regular expression within the text of the file. If found, it should print the filename, a colon, and the text for the first line that contained that pattern. If the -i option is passed, the script should return the opposite files (i.e., those which do not match the expression in file name or contents). The script should be invoked with the following format: find.pl -i perlRegexpPattern ListofFiles where -i is optional Example data is at the bottom of this page For part A, copy those into a directory named "Da" Example: For a directory, Data containing the following files: input.txt proiPerl1.input proiZ.cproiz.h Assuming input.txt contains the following text: proji.c proj1.012.c proj12.c projPerl1.pl trash.txt Hello World This is input for proji Test data find.pl should behave in the following way (the order of the files is insignificant)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!