Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Goals: To learn to use UNIX/Linux file processing utilities to process data in text files. Tasks: 1. In your home directory, make a directory

image text in transcribed

image text in transcribed

image text in transcribed

Assignment Goals: To learn to use UNIX/Linux file processing utilities to process data in text files. Tasks: 1. In your home directory, make a directory called hw3 and change to the hw3 directory. 2. Use the vi editor to create three text file s1, s2, and s3. Each contains a list of full names as follows. Assume a school department offers three scholarships to students. A student can apply for one scholarship or more scholarships. The files s1, s2, and s3 are students who applied for Scholarship 1, Scholarship 2, and Scholarship 3, respectively. The student names are sorted in the alphabetic order Amanda Jones Amber Johnson Brandon Brown Chris Davis Daniel Hall Elizabeth Walker Frank Thompson Jack Moore Kevin Young Nick Turner Noah Parke Robert Wright Tyler Cooper Aaron Smith Amanda Jones Ben Miller Brandon Brown Brian Wilson Daniel Hall Edward Thomas Frank Thompson George Anderson John Martin Loren Adams Noah Parker Peter Hill Steve Jones Wayne Philips Aaron Smith Brandon Brown Chris Davis David Clark Edward Thomas Jack Moore John Martin Kevin Young Michael Harris Nick Turner Peter Hill Robert Wright 3. Use the vi editor to create a script called hw3script and add commands as follows: 3.1. Write commands to find and display the number of students who applied for each scholarship. 3.2. Write commands to find and display students who applied for two scholarships, Scholarship 1 and 2, Scholarship 1 and 3, or Scholarship 2 and 3, respectively 3.3. Write commands to find and display students who applied for all three scholarships. Hints: Store results of 3.2 in intermediate files and use them in step 3.3 3.4. Write commands to find a complete list of students who applied for scholarship(s) and output the result to a file named applicants. The result should NOT contain duplicates. Hints: Merge student names in a proper way and remove the duplicates. 3.5. Use a command to replace "Ben" with "Benjamin" in the applicants file and save the output to a new file applicants final 3.6. Use a command to find all the lines that contain the name "Jones" in the applicants final file 3.7. Write a command to display the final list of students who applied for scholarship(s). 3.8. Write a command to find and display the total number of students who applied for scholarship(s) For your reference, here is a sample output after executing the script: The numbers of applicants for Scholarship 1, 2, and 3 are: 13 15 12 Students who applied for Scholarship 1 and 2: Amanda Jones Brandon Brown Daniel Hall Frank Thompson Noah Parker Students who applied for Scholarship 1 and 3: Brandon Brown Chris Davis Jack Moore Kevin Young Nick Turner Robert Wright Students who applied for Scholarship 2 and 3: Aaron Smith Brandon Brown Edward Thomas John Martin Peter Hill Students who applied for 3 scholarships: Brandon Brown Records containing Jones Amanda Jones Steve Jones The complete list of students who applied for scholarship (s) Aaron Smith Amanda Jones Amber Johnson Benjamin Miller Brandon Brown Brian Wilson Chris Davis Daniel Hall David Clark Edward Thomas Elizabeth Walker Frank Thompson George Anderson Jack Moore John Martin Kevin Young Loren Adams Michael Harris Nick Turner Noah Parker Peter Hill Robert Wright Steve Jones Tyler Cooper Wayne Philips The total number of applicants: 25

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions