In my shell script after executing a few commands, I'm getting the output below:
Name English Maths science Social studies
------ -------- -------- -------- ---------------
James 20 25 30 40
(many values)
(or)
Roll Num Name English Maths science Social studies
--------- ---- -------- ------- -------- ---------------
1 James 20 25 30 40
(Many values)
I want to print the values based on a column heading match.
Example:
cmd(matching Maths) test.txt
o/p:25
I have tried few awk
and sed
commands,But I didn't get proper output.
Can someone help me how to get this?