Instruction: In this program, called missed-probs.awk, you tally, for each problem ID in a CSV file, the number of students that got the wrong answer on the problem, indicated by a non-0 value in the 'score' column. Here's an tiny example input file:
Identifier,prob_id,score,prob_desc
766780,2,0,SQL problem 2
766780,4,2,SQL problem 4
766813,2,0,SQL problem 2
766813,4,1,SQL problem 4
Line 2 shows that student 766780 got the right answer on problem 2. Line 5 shows that student 766813 didn't get the right answer on problem 4.
The problem ID need not be a number, and different input files can have different problem IDs. Don't assume anything about the order of the lines in the input (except that the header line is first).
Here's an example output file:
prob_id,num_missed
2,0
4,2
Line 2 shows that no students missed problem 2. Line 3 shows that 2 students missed problem 4. There is one line in the output for every unique prob_id value in the input.
Hints: you will probably want to set variables FS and OFS (field separator and output field separator). My solution is 18 lines.