awk programming- accepts condition from user

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!

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in the homework & coursework forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.