Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help!! 1.The Home Depot (Ranked 28): home improvement; Atlanta, GA. 2.United Parcel Service (Ranked 48): shipping; Atlanta, GA. 3.The Coca-Cola Company (Ranked 62): soft

Please help!!

1.The Home Depot (Ranked 28): home improvement; Atlanta, GA. 2.United Parcel Service (Ranked 48): shipping; Atlanta, GA. 3.The Coca-Cola Company (Ranked 62): soft drinks; Atlanta, GA. 4.Delta Air Lines, Inc. (Ranked 68): airline; Atlanta, GA.

5.Aflac, Incorporated (Ranked 135): insurance; Columbus, GA. 6.The Southern Company (Ranked 162): energy; Atlanta, GA. 7.Genuine Parts Company (Ranked 183): replacement parts; Atlanta, GA. 8.First Data Corporation (Ranked 249): payment processing; Atlanta, GA. 9.WestRock (Ranked 251): corrugated and consumer packaging; Norcross, GA. 10.HD Supply Holdings, Inc. (Ranked 320): industrial distributors; Atlanta, GA. 11.Suntrust Banks, Inc. (Ranked 329): banking; Atlanta, GA. 12.Mohawk Industries, Inc. (Ranked 338): flooring manufacturer; Calhoun, GA.

Open your terminal and connect to snowball server. Change your directory to your home directory (cd ~ ), and then create a new directory named as Lab4 (mkdir Lab4). After that, go to directory Lab4 (cd Lab4) and please download a file containing the content in the above table by the following command (internet access required):

cp /home/ylong4/public/CompanyList.txt CompanyList.txt

A) Use sed to replace the last two lines by a new line Above are the top 10 companies in GA.

B) Use sed to remove the business industry and location for each company. For example, after deletion, the output for line number 1 should become 1.The Home Depot (Ranked 28), where the colon after (Ranked 28) should also be removed.

C) Use sed to list only the company name on each line by checking in CompanyList.txt. E.g. line 1 in the output is "The Home Depot" E.g. line 12 in the output is "Mohawk Industries, Inc"

D) Replace the period right after the line number by a colon : on each line and save the output to a new file newCompanyList.txt.

E) Use sort to print out the sorted lines in alphabetical order according to the name of location in CompanyList.txt .

F) When a pattern groups all or part of its content into a pair of parentheses, it captures that content and stores it temporarily in memory. You can reuse that content if you wish by using a back-reference, in the form:\1 or $1, where \1 or $1 reference the first captured group (Refer to [1]). For example, the following command reverse "Atlanta" and "GA".

sed -E 's/(Atlanta),\s(GA)/\2-\1/g' CompanyList.txtAttach a screenshot of the output of the above sed command.

G) Now can you write a command to finish task 11) using sed with back-reference?

13) Use awk to finish task in 11) by reading file newCompanyList.txt.

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

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago