Hi
i data looks like this:
student 1
Subject1 45 55
Subject2 44 55
Subject3 33 44
//
student 2
Subject1 45 55
Subject2 44 55
Subject3 33 44
i would like to sum $2, $3 (marks) and divide each entry in $2 and $3 with their respective sums and print for each student as $4 and $5.
desired output:
Student 1
Subject1 45 55 0.368852459 0.357142857
Subject2 44 55 0.360655738 0.357142857
Subject3 33 44 0.270491803 0.285714286
//
student 2
Subject1 45 55 0.368852459 0.357142857
Subject2 44 55 0.360655738 0.357142857
Subject3 33 44 0.270491803 0.285714286
Please help me with awk or perl
Many thanks in advance