I have an assignment, need your help to complete it. I am trying as well from my end but need help to complete.
emp.csv
(contains emp details, say 5k records)
empid,ename,sal,comm
100,Patrick,75000,10
200,Lisbon,80000,5
300,Van,50000,null
400,Wayne,65000,2
500,Kimball,70000,7
600,Luther,72000,null
Q1. Read the emp.csv
file using awk
.
Q2. Calculate revised salary of all employees.
a) Display output on screen
b) Redirect output to a file called sample1.csv
Hint- Revised sal=sal+ (sal*comm)
If comm
is null, assume comm=0
so, revised sal=sal
Q3. Displays output based on condition asked.
Prompts the user with a msg:-
Enter the condition
eg- We have to enter required condition say, sal > 70000 and comm is null
a) Display first 50 records (desc order of revised salary) on screen
b) Redirect output of all employees to file sample2.csv
Please do help me.
I am able to read the emp.csv
using awk
and I am trying the other questions from my end.
Thanks in advance!