You have been provided an unsorted file of names (/usr/local/course...

  1. Home
  2. Homework Library
  3. Computer Science
  4. Linux
  5. You have been provided an unsorted file of names (/usr/local/course...

QuestionQuestion

You have been provided an unsorted file of names (/usr/local/courses/clark/cs3423/2017Fa/Proj3/unsortedNames.txt). Each name ends with a last name and may have multiple names and/or initials before the last name (unfortunately it varies). Use awk and sort to create a file sorted by last name. This may involve multiple awk and one sort step. The resulting sorted file should look similar to the original file except that it is sorted by last name.

Hint: Since the number of words in a name varies, we need to create an intermediate that has the last name first to simplify sorting. After sorting, we no longer want that last name as the first value.

Create a bash file named p3a.bash to create the sorted file. Besides the shebang line, there should be only one other line in the bash file. That line must use pipes between the steps.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

# as the hint says, we join the last field from each row at the beginning of the row using a different delimiter - pipe in this case


# then we sort on the 1st field by pipe


#and discard the 1st field before printing the 2nd field with delimiter...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$15.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Linux Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats