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
The objective of this task is to use Scapy to estimate the distance, in terms of number of routers, between your VM and a select
Aleksandr [31]

Answer:

answer b

is correct

3 0
3 years ago
Protocols at which layer of the OSI model have the primary function of moving datagrams through an internetwork connected by rou
Vladimir [108]

Answer:

"Network layer" is the correct answer to the given question .  

Explanation:

The network layer is interconnected with different networks by providing permission to the network. This job is done by sending the packets in the network. The main aim of the network layer is to provide the logical addressing, routing, and fragmentation of packets.

The network layer is the layer of the OSI model whose primary function is moving the packets or datagrams in the internetwork which is connected by the routers.  

5 0
3 years ago
Write a java program that accepts the ingredients for a recipe in cups and converts to ounces
Tanzania [10]

Answer:

Explanation:

public static int cupsToOunces (int cups) {

   

       int ounces = cups * 8;

       return ounces;

       

   }

This is a very simple Java method that takes in the number of cups in the recipe as a parameter, converts it to ounces, and then returns the number of ounces. It is very simple since 1 cup is equal to 8 ounces, therefore it simply takes the cups and multiplies it by 8 and saves that value in an int variable called ounces.

6 0
3 years ago
What is the most important trait of the first pilot project in the AI Transformation Playbook?
MissTica

Answer:

Succeed and show traction within 6-10 months.

Explanation:

Ai (Artificial Inteliigence), also known as machine intelligence, is a branch of computer science that is specialized in making smart machines that are capable of doing human tasks

AI Transformation Playbook is a guide to use AI in enterprises successfully, written by Co-founder of Google Brain, Andrew Ng. In his guide, he unveiled the steps that can be followed to successfully installing AI in enterprises, companies, etc.

The most important trait of the first pilot projects is that it succeeds and begins to show traction within 6-10 months.

In his guide, he summarised five steps to install AI in enterprises. The first step is to 'Execute pilot projects to gain  momentum.'

The most important trait of beginning with AI projects is that it succeeds first before being most valuable projects. The success is important as it will help to achieve familiarity and will help other people of the company to invest in this project more.

This success begins to show tractions within 6-12 months of its success.

8 0
3 years ago
When installing a SATA hard drive, is it true or false that you need to move the jumpers on the back of the drive to instruct th
antiseptic1488 [7]

Answer:

This is false.

Explanation:

SATA drives do not have jumpers, because they don't use the master/slave feature. They are connected to the motherboard, and they are ready to work.

The master/slave feature was used by IDE hard drives.15 years ago, most motherboards didn't have too many IDE slots to place more than 1 or 2 HDDs, the IDE cable allowed you to connect 2 drives to 1 cable, greatly increasing your computer's storage space.

It was recommended to set as master the drive connected directly to the motherboard, and the other one as slave.

7 0
3 years ago
Other questions:
  • HELLLLLP ill make you brainiest and ill give u a lot of points if you HELP ME Directions Part One.
    12·2 answers
  • Difference between volatile and non volatile memory
    14·2 answers
  • What is the meaning of the word joystick
    6·2 answers
  • The first step in the information processing cycle is _____, which involves entering data into the computer.
    8·1 answer
  • Arrange the binary number in increasing order of their arithmetic output in the decimal number system ?
    9·1 answer
  • I need le help, darn ijourneys
    10·2 answers
  • What programming language does the LMC 'understand'?
    5·1 answer
  • 1 punto
    11·1 answer
  • Why can it be helpful to perform mathematical calculations using programming? Choose the best answer.
    11·1 answer
  • Compare gigabytes GB, kilobytes and terabytes.​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!