Hello! Unix. Awk script programming question! What needs to be done is to use th
ID: 3816715 • Letter: H
Question
Hello! Unix. Awk script programming question! What needs to be done is to use the awk and write a script that will do various things with the file called input file. input file's contents are displayed at the bottom. Psuedo code or help in starting and solving the program. I am having issues figuring out how to develop the program and meet the requirements. Thanks in advance!!
Input
The input file will be given at the bottom.
The lines in the input file use ":" as field separator.
There are 3 types of lines in the file:
1. lines that describe products have the following fields:
product id: an integer number
product category: alphanumeric text
description: alphanumeric text
price: floating point number, with 2 significant digits
2. lines that describe associates have the following fields:
associate id: an integer number
name: alphanumeric text
position: alphanumeric text
3. lines that describe sales have the following fields:
transaction id: an integer number
product id: an integer number
quantity: an integer number
date: in the form of mm/dd/yyyy
associate id: an integer number
Error Checking
If any error is encountered, such as incorrect data in the input file, just skip the line in question. Nothing
further needs to be done to recover and use the values of the line.
Output (this is what the completed script/program should look like)
% awk -f 500.list inputfile11
Log!c Co.
2014 Sales Associates Ranking
Name Position Sales Amount
==========================================
Buck, Fast Developer 2628.80
Rush, George Salesman 1051.77
Worker, Susan Developer 360.00
Doe, John Clerk 134.01
Lindon, Rosemary Producer 31.00
Miller, Dennis Comedian 9.90
File 'input file' (this is the file name and its contents are below) (this is also the file that is unchanged. I need to sort the list by the requirements listed above and in the same format as above)
1:software:Word Processor:55.00
2:software:Bad Wolf Video Game
:19.99
3:software:Return to Gallifrey Video Game:59.99
4:vehicle:TARDIS:999999.99
5:hardware:
sonic screwdriver:9999.99
6:merchandise:
company t-shirt:20.00
1:Davy Jones:Security
2:Ricky Davis:Developer
3:Samantha Smith:Salesperson
4:Matt Smith:Doctor
5:David Tennant:Doctor
6:Buckminster
Fuller:Engineer
7:Clara Oswald:Nurse
8:Amelia
Pond:Nurse
1:1:1:01/02/2011:2
2:2:1:02/04/2012:2
3:3:1:03/06/2013:5
4:4:1:
11/05/2013:5
5:1:1:01/12/2013:2
6:2:2:02/11/2013:2
7:3:1:05/13/2013:6
8:6:3:
06/24/2013:1
9:5:1:02/02/2011:5
10:1:1:05/01/2012:5
11:2:1:11/05/2013:5
12:3:
1:12/06/2013:5
13:2:1:02/12/2013:5
14:1:1:10/16/2013:5
15:6:4:05/18/2013:3
16:
5:1:06/28/2013:6
17:1:1:07/30/2013:5
18:2:1:08/04/2013:7
19:3:1:09/07/2013:5
18:
2:1:08/04/2013:7
19:3:1:09/07/2013:5
20:6:1:10/17/2013:4
20:6:1:10/17/2013:8
Once again, any help is appreciated. Thank you!
Explanation / Answer
=================================================================
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.