Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Database And Expert Systems Applications Dexa 2021 Workshops Biokdd Iwcfs Mlkgraphs Al Cares Protime Alsys 2021 Virtual Event September 27 30 2021 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Anna Fensel ,Jorge Martinez-Gil ,Lukas Fischer

1st Edition

3030871002, 978-3030871000

More Books

Students also viewed these Databases questions