Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Homework on Grep and Regular Expressions Date:28/03/2018 In the file grep data f

ID: 3740224 • Letter: H

Question

Homework on Grep and Regular Expressions Date:28/03/2018 In the file grep data file contains the following information Name: Area-Tel Number Num Load, City, State zip code month date year income You are asked to write down the commands that used to Print the required information in the file according to the following instructions 1. Display all line containing "San" 2. Display all lines starting with letter 3. Display all the lines ending with 7000 4. Display all the lines without "834 5. Display all ines with a birthday in December 6. Display all lines with an area code of 83:S 7. Display all lines with a given name that contains 4 letters, and a family name starts with For S 8. Display all lines with a family name starting with K or k 9. Display the line number and contents of all lines with an income having 6 dgits 10.Display lines containing "Lincoln or lincoln, using an option of "grep" that ignores letter case

Explanation / Answer

As per chegg guidelines we are allowed to answer only first 4 parts of the question. Please post other parts in seperate question. Let me know if you have any doubts in this:

1. grep "San" grep_data_file

Explanation: grep "San" will display all the line which is having "San" in it.

2. grep "^J" grep_data_file

Explanation: "^" indicates the starting of the line

3. grep "7000$" grep_data_file

Explanation: "$" indicates the ending of the file

4. grep -v "834" grep_data_file

Explanation: "-v" will remove the line that will have "834" in it.