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

Maximum number of nodes in a binary tree, The maximum number of nodes in a ...

The maximum number of nodes in a binary tree of depth 5 is 31 is the maximum number of nodes in a binary tree

Illustrate about the macros and give its example, Illustrate about the macr...

Illustrate about the macros and give its example For instance, assume you want some data to be input into a spreadsheet if result of a calculation in cell K40 is negative: m

What do you mean by supercomputers, Q. What do you mean by Supercomputers? ...

Q. What do you mean by Supercomputers? The upper end of state of art mainframe machine is supercomputers. These are among the fastest machines in terms of processing speed and

Defined for one match code object, What is the max no of match code Id's th...

What is the max no of match code Id's that can be defined for one Match code object? A match code Id is a single character ID that can be a letter or a number.

What are the different layers of tcp/ip protocol stack, What are the differ...

What are the different layers of TCP/IP protocol stack? Layers in the TCP/IP protocol architecture are:- o  Application Layer o   Host-to-Host Transport Layer,  o  Net

Computer to computer transmission of structured data, Computer to computer ...

Computer to computer transmission of structured data using standardised documentation is known as Electronic data interchange (EDI).

What is imprecise and precise exception, What is imprecise and precise exce...

What is imprecise and precise exception? Situation in which one or more of the succeeding instructions have been implemented to completion is known as imprecise exception. Situ

Dataset accept changes and data adapter update method, Explain Dataset Acce...

Explain Dataset Accept Changes and Data Adapter Update methods?  Data Adapter Update method Calls the respective INSERT, UPDATE, or DELETE statements for every inserted, update

Demultiplexers, Explain briefly about demultiplexers?

Explain briefly about demultiplexers?

What are different types of log records, What are different types of Log re...

What are different types of Log records? V1 and V2.  V1 must be processed before V2.  But, we can have more than single V2 logs

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