1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
e-lub [12.9K]
3 years ago
8

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
Computers and Technology
1 answer:
Hatshy [7]3 years ago
8 0

Answer:

Script is given below

Explanation:

Below is the AWK code for the Report.I have used the sample data that your have shared in the question.

AWK code-

echo "Hello World!"

echo "2011 Jan X 29.44 17.33 43.21" > inputfile.txt

echo "2014 Jan Y 32.32 12.12 99.00 1.99 " >> inputfile.txt

echo "2012 Jan X 321.11 12.34 10.99" >> inputfile.txt

echo "2012 Feb Y 1.99 12.75" >> inputfile.txt

echo "2012 Feb X 32.99 65.78 98.76" >> inputfile.txt

echo "2014 Jan Y 12.99 17.44 21.34" >> inputfile.txt

echo "2012 Mar X 11.45" >> inputfile.txt

awk -F" " 'BEGIN{ X_sum=0;

print(" Sales Data for year 2014")

print("========================")

}

{ if($1=="2014")

{

print($2,":", $4+$5+$6+$7+$8+$9+$10+$11+$12+$13)

}

if($3=="X")

{

X_sum=X_sum+$4+$5+$6+$7+$8+$9+$10+$11+$12+$13

}

if($3=="Y")

{

Y_sum=Y_sum+$4+$5+$6+$7+$8+$9+$10+$11+$12+$13

}

if($3=="Z")

{

Z_sum=Z_sum+$4+$5+$6+$7+$8+$9+$10+$11+$12+$13

}

 

}

END { print(" ========================")

print("Station volume for 2014 is:")

print("X:" ,X_sum )

print("Y:" ,Y_sum )

print("Z:" ,Z_sum )

}

' < inputfile.txt

You might be interested in
When using presentation aids A. make the aid available for the audience to look at throughout the speech. B. prepare to give you
DanielleElmas [232]

Answer: options A and B.

Option A, make the aid available for the audience to look at throughout the speech.

Option B, prepare to give your presentation without the aids, incase problem arises.

Explanation:

Presentation aids, sometimes also called sensory aids, are the resources beyond the speech itself that a speaker uses to enhance the message conveyed to the audience.

The type of presentation aids that speakers mostly make use of are visual aids; pictures, diagrams, charts and graphs, maps... Audible aids (musical excerpt, sound effects) and olfactory aids (fragrance samples or food samples) are also used.

* Presentation aids can be used throughout the speech but it should be used for essential points so as to to tire or bore the audience.

* Ensure presentation still works without the presentation aids in case of technical problems or if any problem arises at all.

* While explaining the aids, focus should be on the audience and not the presentation aids itself.

* Practice should be done with the presentation aids in advance so as to avoid any error while presenting.

Therefore, options A, B should be done when using presentation aids.

6 0
3 years ago
Which of the following is not a key component of a structure?
valentina_108 [34]
D. Enumerations! Because I know that is NOT a leg compentent of a structure
5 0
2 years ago
Whats the relationship between the CPU and motherboard
Mashcka [7]

Answer:

Both perform processes vital to running the computer's operating system and programs -- the motherboard serves as a base connecting all of the computer's components, while the CPU performs the actual data processing and computing.

Explanation:

6 0
3 years ago
The software used to help run the computer hardware is the _____.
TiliK225 [7]
C. system software
if it means drivers and so on
6 0
3 years ago
Read 2 more answers
Use a spreadsheet to solve this business problem. The owners of an electronics store want to find which of their products makes
Tom [10]

Answer:

Computer Monitors earned him maximum profit. For details, please check the attachment.

Explanation:

Please check the attachment.

Download xlsx
5 0
3 years ago
Other questions:
  • Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort
    13·1 answer
  • Plz answer me will mark as brainliest picture included ​
    15·1 answer
  • The optional feature in a business letter is
    10·1 answer
  • You run the ipconfig command on your computer, and it reports an IP address of 169.254.75.10 on the Ethernet interface. Which de
    8·1 answer
  • Is it necessary that every autonomous system use the same intra-AS routing algorithm? Why or why not?
    10·1 answer
  • Enum Digits {0, 1};
    10·1 answer
  • Determine the following information about each value in a list of positive integers.
    14·1 answer
  • Does anyone have 2.19.4 Guess a number 2.0 code for codehs?
    8·1 answer
  • What is food technology​
    5·1 answer
  • Instruction: Decide what the total marketing budget will be, and make a list of at least four things you will spend money on and
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!