Write an awk program - unix , Computer Engineering

Assignment Help:

Write an AWK program which takes the following input file and processes it.

$cat data.txt
John Do 111-1111 English 90 Maths 80
Alice Do 222-2222 English 90 Maths 90 Chemistry 93

The input file has first 3 fields fixed as first name, last name, and student id. After the student id, it has a variable number of fields which has a pair of name of a subject and points scored in that subject. Your output should print the full name of the student, number of subjects taken, and his/her average score. The output corresponding the above input file is as follows:

$awk -f avgerage.awk data.txt

John Do: 2 subjects taken, average = 85

Alice Do: 3 subjects taken, average = 91


Related Discussions:- Write an awk program - unix

How do we bind keys to menus for shortcuts in gimp, Make ensure that "Use d...

Make ensure that "Use dynamic keyboard shortcuts" option in "Interface" tab of Preferences dialog is enabled, then go to the menu selection you are interested in. Keeping it select

Spatial domain interpolation, Transfer Domain Create an interpolation al...

Transfer Domain Create an interpolation algorithm using the fast Fourier transformer. Assess the performance of the algorithm by using the PSNR and SSIM.  Compare your results w

What is branch instruction, What is branch instruction? As a result of ...

What is branch instruction? As a result of branch instruction is a type of instruction which loads a latest values into the program counter.

What are escape sequences characters, What are escape sequences characters?...

What are escape sequences characters? List any six of them.  The characters which when used with output functions like printf( ),putc(),put() etc. helps in formatting the outpu

Access to external identifiers, Access to External Identifiers: An external...

Access to External Identifiers: An external identifier is one which is referred in one module though defined in another. You can declare an identifier to be external by including i

Explain form and input tag, Q. Explain FORM and INPUT Tag? A good way t...

Q. Explain FORM and INPUT Tag? A good way to learn about forms is to make use your notepad editor and make a new HTML document. Save it as form1.htm in some folder somewhere. Y

What are the advantages of using uml, Benefits of using UML breaks the comp...

Benefits of using UML breaks the complex system into discrete pieces that can be understood simply. Handover the system to new team becomes simpler. Complex system can be un

Recombination and mutation, Recombination and Mutation: In such a scen...

Recombination and Mutation: In such a scenario the point of GAs is to generate population after population of individuals that represent possible solutions to the problem at h

How to call a wml script from a wml page, WML & WML Script 1. How to ca...

WML & WML Script 1. How to call a WML Script from a WML Page? 2. Write a brief note on WML Script Operators and Expressions. 3. Write brief notes on WML Script Statements

Illustrate minimization of gates, Q. Illustrate Minimization of Gates? ...

Q. Illustrate Minimization of Gates? The generalization of Boolean expression is much useful for combinational circuit design. The subsequent three techniques are used for this

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd