You have been given the file awards.psv This file contains information about Nobel Prize, Turing Award and Fields Medal winners Each line in the file contains the following six fields: 1. Award Name 2. Award Year 3. Winner Name 4. Winner Gender 5. Winner Country 6. Winner Birth Year Each field is separated from the next field by a pipe character ( | ). Your task is to write four grep commands which will print specified lines from this file. You have been given the file final_q1.txt . In final_q1.txt add answers to the four questions. Add each answer in the specified location. Do not add, remove, or change any other text in the file. The autotest depends on the exact format of the file. Each question should be answered with a single grep command. You may use any regular expression syntax supported by grep. You may use any options supported by grep except -P/--perl-regexp . 1. Question 1 Write a grep command that will print the lines in awards.psv that contain awards won by an Australian.
You have been given the file awards.psv
This file contains information about Nobel Prize, Turing Award and Fields Medal winners
Each line in the file contains the following six fields:
1. Award Name
2. Award Year
3. Winner Name
4. Winner Gender
5. Winner Country
6. Winner Birth Year
Each field is separated from the next field by a pipe character ( | ).
Your task is to write four grep commands which will print specified lines from this file.
You have been given the file final_q1.txt .
In final_q1.txt add answers to the four questions.
Add each answer in the specified location.
Do not add, remove, or change any other text in the file.
The autotest depends on the exact format of the file.
Each question should be answered with a single grep command.
You may use any regular expression syntax supported by grep.
You may use any options supported by grep except -P/--perl-regexp .
1. Question 1
Write a grep command that will print the lines in awards.psv that contain awards won by an Australian.
2. Question 2
Write a grep command that will print the lines in awards.psv that contain a female ACM Turing Award winner.
3. Question 3
Write a grep command that will print the lines in awards.psv that contain awards won by a person born between 1990 and 1999
(inclusive).
4. Question 4
Write a grep command that will print the lines in awards.psv that contain awards won by a person with first name, last name, and
middle initial starting with the same letter.
Your example to each question will be a single grep command.
You can test the command by running it.
For example, if you think the answer to question 1 is grep -E 'Andrew' awards.psv ,
you can test it:
$ grep -E 'Andrew' awards.psv
ACM Turing Award|2000|Andrew Chi-Chih Yao|Male|China|1946
Nobel Prize for medicine|1963|Andrew F. Huxley|Male|United Kingdom|1917
Nobel Prize for medicine|2006|Andrew Z. Fire|Male|United States|1959
Nobel Prize for medicine|1977|Andrew V. Schally|Male|United States|1926
ACM Turing Award|2017|David Andrew Patterson|Male|United States|1947
Then add it to final_q1.txt .
Autotest will extract your answers from final_q1.txt and do a simple test.
NOTE:
Your answer for each question must be a single grep command only
For example: grep -E Andrew awards.psv
You may not use the -P/--perl-regexp option to grep
You may use any other grep option, for example you can use grep's -E option.
You may quote the arguments to grep.
You may not use any commands other than grep, for example, you can not use sed or cut.
You can not use pipes, or I/O redirection.
You can assume that the pipe character ( | ) will only appear as a field separator.
Note the input is unordered. It is not sorted in any way.
You may not use Shell , C , Python , Perl , or any other language.
When you think your program is working, you can run some simple automated tests:
$ 2041 autotest final_q1
When you are finished working on this activity, you must submit your work by running give:
$ give cs2041 final_q1 final_q1.txt
To verify your submissions for this activity:
$ 2041 classrun -check final_q1
Step by step
Solved in 2 steps