Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an awk script that produces a report from an input file. The report summarizes sales data as recorded for sales stations. The input file

Write an awk script that produces a report from an input file.

The report summarizes sales data as recorded for sales stations. The input file contains sales data for several years, however, your report should only list data for the year 2014.

The awk script file name must be "z123456.report", where z123456 is your Z-id. The awk script is invoked from the command line with an input file that contains data for multiple years:

awk -f z123456.report inputfile. txt

The lines in the input file have the following fields:

year: four digit integer number

month: three letter abbreviation of a month

station: one letter station code

sale amounts: floating point numbers, with 2 significant digits. Each input line will have at least one and at most 10 amount fields.

Here is an example of input sales data ==> click here to download image text in transcribed

 2011 Jan X 29.44 17.33 43.21 2014 Jan Y 32.32 12.12 99.00 1.99 2012 Jan X 321.11 12.34 10.99 2012 Feb Y 1.99 12.75 2012 Feb X 32.99 65.78 98.76 2014 Jan Y 12.99 17.44 21.34 2012 Mar X 11.45 ...

Your awk script should produce a report that lists the 2014 sales amount per month and station. In addition the report should list the sum of all sales per station for the year 2014, the total sales for the year, and how many records from the input file were processed.

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions