I REALLY NEED HELP WITH THESE HERE IS MORE INFO 5) Write the command to count th
ID: 3792341 • Letter: I
Question
I REALLY NEED HELP WITH THESE
HERE IS MORE INFO
5) Write the command to count the number of companies located at Atlanta or Norcross by checking file CompanyList.txt. (Hint: use Pipe 'l' and wc) 6) Type command sed n /Inc/p' Company List.bkt and execute it. Then please describe what does this command do? And why we need -n option in this command? 7) Use sed to remove the empty lines in Co 80 Use sed to remove the company number (including the period after the number in Companylist.txt. (Hint: think about the meaning of regex /[n.]*/ and do not use g option for substitution) 9) see sed to remove the empty lines and the company number (as in question 7) &8), then save the output to file newCompany.List.ixt. (Hint: a sample of the newCompanyList txt is given in my home folder. Please use following command to check the content in it cat /home/local/GSUAD/ylong4/public/newCompanyList.txt 10) Use sed to add text "headquartered in" before the location of company in newCompany List.ixt. Eg, change "Atlanta, GA, to "headquartered in Atlanta, GA." 11) Use sed to insert a new line "Fortune 500 companies set up shop in Georgia" newCompanyList.txt 12) Sort newCompany List.txt according to the names of companyExplanation / Answer
5) piping redirects the output of one command as the INPUT of the immediate next command, so for this question -
i'll need to look at the file to see how to parse companies from the text, but the idea is this -
(parse the company/area part from the text) | wc -l (this will give the number of lines i.e. numbr of componies)
--------------------
6) sed helps to filter text.
what we will see as an output is the output consisting of only words which have '/Inc/p' in them.
-n will suppress the automatic printing of the other text
or, just to get the words with 'Incp' and nothing else we need -n.
----------
7)
-----------------
8) would need to see the file for this, but the method should be the same as 7)
-------------
9) let us call the command used to solve 7 as c1 and 8 as c2 , then answer to 9 is
c1 | c2 < /home/local/.../newCompanyList.txt
-------
11) to insert a new line with sed
where xyz is the line BEFORE which the new line is to be inserted. is to escape the "".
-------------
12) use awk
thank you
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.