Question: Hello, I am working with .awk files in the Ubuntu linux command line. I thought I answered the questions correctly, but my teacher said I
Hello, I am working with .awk files in the Ubuntu linux command line. I thought I answered the questions correctly, but my teacher said I should not submit the commands, she wants to see the scripts. So, here are the questions, could you please help me write the scripts?
Task1: Write an awk script that will output the sum of all the sales figures.
| Input file (hw0409.csv) | Example output |
| Name,Emp ID,Sales,Dept,Resi Andrew,24,88,Eng,Y Brandon,66,14,Mkt,Y Chelsey,8,,Eng,N Deborah,38,,Ift,Y Erik,32,13,Mkt,N Arielle,13,48,Eng,N Shaun,55,78,Ift,N Ninette,3,24,Opr,Y Nguyen,10,54,Eng,Y | SUM: 319 |
Task2: Write an awk script that will output the average of all the sales figures.
| Input file (hw0409.csv) | Example output |
| Name,Emp ID,Sales,Dept,Resi Andrew,24,88,Eng,Y Brandon,66,14,Mkt,Y Chelsey,8,,Eng,N Deborah,38,,Ift,Y Erik,32,13,Mkt,N Arielle,13,48,Eng,N Shaun,55,78,Ift,N Ninette,3,24,Opr,Y Nguyen,10,54,Eng,Y | AVG: 35.4444 |
Thank you!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
