I am very new to the shell script and need help
I have 2 files i.e
Student.txt
001, Peter, class3
002, Mohit, class4
and so on...
Marks.txt
001, History, 45
001, Maths, 55
002, computer, 76
002, Maths, 96
and so on...
I want to read the first word (i.e. Roll No. )from Student.txt i.e. 001,002 in my example and then search the content (roll no.) in another file Marks.txt 1st word AND 2nd word should be "History", (condition: $1 == roll no && $2 == History)
I going through awk cmd and tried but not able to make a complete solution
awk -F "," '{ print $1 }' student.txt awk -F "," '{ print $1, $2 }' marks.txt