Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 3 (50 points): Ted Williams was a baseball player that played Major League Baseball for 19 seasons between the years 1939 and 1960 and
Task 3 (50 points): Ted Williams was a baseball player that played Major League Baseball for 19 seasons between the years 1939 and 1960 and is considered The Greatest Hitter That Ever Lived". Some of his statistics are stored in TeddyBallgame.csv on myCourses. You will be performing several tasks using this file. See the top line of the file for the definition of each field in the file. Note that since this is a .csv file, all fields are separated by commas. Task 3a (5 points): Write a single command that removes the top line of the file, replaces commas with spaces, and saves the output to a file called TeddyBallgame.txt. Also show the contents of TeddyBallgame.txt in your screenshot (you should use a separate command to display the output to the console) kinsert screenshot here> Task 3b (15 points): Use TeddyBallgame.txt from Task 3a as a starting point for this task. Write a single command to output the list of all seasons where Ted Williams had 100 or more Runs Batted In. Your output should only include the year and the number of Runs Batted In during that year. Kinsert screenshot here> Task 3c (15 points): Use TeddyBallgame.txt from Task 3a as a starting point for this task. Write a single command to output the list of all seasons where Ted Williams hit 30 or more Home Runs. The list should be sorted from most Home Runs to least and the final output should include the fields Year, Home Runs, Runs Batted In, and Batting Average for those seasons. See expected output below. 1949 43 159 .343 1957 38 87.388 1946 38 123 .342 1941 37 120 .406 1942 36 137 .356 1947 32 114 .343 1939 31 145 .327 1951 30 126 .318 Kinsert screenshot here> Task 3d (15 points): Use the output of Task 3c as a starting point for this task either as a redirected output file or add more pipes to the command from Task 3c. Write a single command to sort the seasons from Task 3c by Runs Batted In from low to high. See expected output below. 1957 38 87 .388 1947 32 114 .343 1941 37 120 .406 1946 38 123.342 1951 30 126 .318 1942 36 137 .356 1939 31 145 .327 1949 43 159 .343 kinsert screenshot here> Task 4 (20 points): Write a single command that stores (in a file called out.txt) the names of all .conf files located in /etc that contain an IP address beginning with "192.168". Show the contents of out.txt in your screenshot using a separate command. See expected contents of out.txt below. It's ok if your command generates error messages when it's executed. To suppress error messages, you can redirect the error stream to /devull /etc/chrony.conf /etc/dnsmasq.conf /etc/ipsec.conf /etctp.conf /etc/rsyslog.conf kinsert screenshot here> 1 XfYear GamesPla HomeRun RunsBatte BattingAverage 20 1 Year 1 8 1939 1940 1941 1942 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 149 144 143 150 150 156 137 155 89 148 145 113 120 137 123 114 0.327 0.344 0.406 0.356 0.342 0.343 127 0.369 0.343 97 0.317 126 0.318 23 37 27 28 2 159 28 40.407 89 0.345 0.356 0.345 0.388 0.328 0.254 0.316 37 35 37 136 132 129 103 113 24 82 2 20 72 Task 3 (50 points): Ted Williams was a baseball player that played Major League Baseball for 19 seasons between the years 1939 and 1960 and is considered The Greatest Hitter That Ever Lived". Some of his statistics are stored in TeddyBallgame.csv on myCourses. You will be performing several tasks using this file. See the top line of the file for the definition of each field in the file. Note that since this is a .csv file, all fields are separated by commas. Task 3a (5 points): Write a single command that removes the top line of the file, replaces commas with spaces, and saves the output to a file called TeddyBallgame.txt. Also show the contents of TeddyBallgame.txt in your screenshot (you should use a separate command to display the output to the console) kinsert screenshot here> Task 3b (15 points): Use TeddyBallgame.txt from Task 3a as a starting point for this task. Write a single command to output the list of all seasons where Ted Williams had 100 or more Runs Batted In. Your output should only include the year and the number of Runs Batted In during that year. Kinsert screenshot here> Task 3c (15 points): Use TeddyBallgame.txt from Task 3a as a starting point for this task. Write a single command to output the list of all seasons where Ted Williams hit 30 or more Home Runs. The list should be sorted from most Home Runs to least and the final output should include the fields Year, Home Runs, Runs Batted In, and Batting Average for those seasons. See expected output below. 1949 43 159 .343 1957 38 87.388 1946 38 123 .342 1941 37 120 .406 1942 36 137 .356 1947 32 114 .343 1939 31 145 .327 1951 30 126 .318 Kinsert screenshot here> Task 3d (15 points): Use the output of Task 3c as a starting point for this task either as a redirected output file or add more pipes to the command from Task 3c. Write a single command to sort the seasons from Task 3c by Runs Batted In from low to high. See expected output below. 1957 38 87 .388 1947 32 114 .343 1941 37 120 .406 1946 38 123.342 1951 30 126 .318 1942 36 137 .356 1939 31 145 .327 1949 43 159 .343 kinsert screenshot here> Task 4 (20 points): Write a single command that stores (in a file called out.txt) the names of all .conf files located in /etc that contain an IP address beginning with "192.168". Show the contents of out.txt in your screenshot using a separate command. See expected contents of out.txt below. It's ok if your command generates error messages when it's executed. To suppress error messages, you can redirect the error stream to /devull /etc/chrony.conf /etc/dnsmasq.conf /etc/ipsec.conf /etctp.conf /etc/rsyslog.conf kinsert screenshot here> 1 XfYear GamesPla HomeRun RunsBatte BattingAverage 20 1 Year 1 8 1939 1940 1941 1942 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 149 144 143 150 150 156 137 155 89 148 145 113 120 137 123 114 0.327 0.344 0.406 0.356 0.342 0.343 127 0.369 0.343 97 0.317 126 0.318 23 37 27 28 2 159 28 40.407 89 0.345 0.356 0.345 0.388 0.328 0.254 0.316 37 35 37 136 132 129 103 113 24 82 2 20 72
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started