Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment, you will write gawk and sed commands as well as a bash script to accomplish certain requested functionality. Given the many powerful
In this assignment, you will write gawk and sed commands as well as a bash script to accomplish certain requested functionality. Given the many powerful features of gawk and sed, you are provided with a link to a tutorial for gawk as well as sed to assist you in completing this assignment. Using gawk For help using gawk, you may find the tutorial http://www.grymoire.com/Unix/Awk.html useful a) Consider the following file called numbers.txt: Numbers 4 92 18 14 75 28 12 34 60 82 Each line (ie, record) contains only one field gawk script that prints the sum and average of all integers contained in the file Obviously, you need to skip the first two lines that contain header information. In this file, for example, the gawk script should print: 449 37.4167 a positive integer. Write a one-line b) Consider the following file called elems.txt 1,H,Hydrogen 2,He,Helium 3,Li. Lithium 4,Be,Beryllium 115,Mc,Moscovium 116,Lv,Livermorium 117,Ts,Tennessine 118,0g,Oganesson Since the shown file is incomplete, the elems.txt file is provided with this assignment. This file contains a list of the elements in the periodic table. Each field in this file is separated by a comma and each record is separated by a newline character. First, write a one-line gawk script that prints out just the record number and the element symbol (e.g., He) of all the elements in the list that do not contain a vowel (i.e., 'a', 'e', 'T, 'o', or 'u') in the element symbol (e.g., H or Mc). Note that your results should include element symbols with one or two characters
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