Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on the files sety, addr and groups provided at the end of this documents, provide the solutions for below questions. For questions 1 -

Based on the files sety, addr and groups provided at the end of this documents, provide the solutions for below questions.

For questions 1 - 3: Consider the file sets for below questions :

Provide the command (and the output) to display the lines that contain the literal character $

Provide the command (and the output) to display the lines that contain the literal character .

Provide the command (and the output) to display the lines that contain the literal character ;

For questions 4 - 5: Consider the file addr

Write the command and the output to print all entries in the addr file for which the email address is from a valid educational institution(ends with .edu)

What is the difference between the two commands (or regular expressions) below?

grep * filename

grep \* filename

For questions 6 - 17: Consider file addr , Provide the command as well as the output

6. Use egrep with pipe to extract information for Elizi , Ma , and Jackson.

7. Use egrep with { } to extract lines with valid zip code

8. Use egrep with { } to extract lines with invalid zip code

Sort the addr file by phone number and print lines 1 through 3.

Print the lines that end with valid zip code. Use sed.

Print the lines that end with invalid zip code. Use sed.

Add the string School Email next to all email addresses ending with .edu. Use sed.

Provide the sed command to get rid of the lines with private email addresses

Provide the command to print the rows that use imap number. Use AWK.

Provide a command to print only the first name, last name and email address of the person.

Print the names, phone number, and zip in a tabular manner

Print the Last Name, First Name, Email Address and zip in a tabular format. Include the header identifying each field.

For questions 18 - 20:Provide the command, script file content and the output for the below questions

18. Write an awk script file to print the Last Name, First Name and email address of a student with a header and a footer.

19. Refer to the file "groups" and print the list of user names and their groups. Use a script file with a header and footer.

20. Refer to the file groups and write an awk script file which would accept a userID input and display the group name for that userID as output.

Files

sets

$1+ $2 = 4.3;

This is a $5 note.

This line does not contain a dot but has a $

This has a semi colon;

Addr (Column 1 LastName, Column2: First name, Column3: email address, Column4: phone number, Column5: zip code)

Felton, Tom,tfelton..com,85281345,543781,imap987648790

Potter, Harry,hpotter@hogwarts.edu,853645555,875234

Granger,Herminone,hgranger@hogwarts.edu,9856017638,334567

Moe,Elizi,emoe@.com,3892000109,345678

Ta,Ma,mata@asu.edu,6747829191,85281

Five,Jackson,jfive@asu.edu,7839209871,78339

Murphy,Sean,smurph2@asu.edu,56783908156,78648

Kelly, Grace, gkelly@asu.edu,6784937689,9873329

groups (Column 1- Group ID, Column 2: Group Name, Column 3: UserID)

1,Griffindor,hpotter

2,Hufflepuff,cdiggory

4,Slytherin,ssnape

3,Ravenclaw,cchang

1,Griffindor,rweasley

1,Griffindor,hgranger

3,Ravenclaw,llovegood

4,Slytherin,dmalfoy

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago

Question

4. Design a career management system.

Answered: 1 week ago

Question

4. Evaluation is ongoing and used to improve the system.

Answered: 1 week ago

Question

6. Effectively perform the managers role in career management.

Answered: 1 week ago