I want to print only those numbers of a column which is greater than certain number provided by the user. My file is like this:
Name,roll_no,marks
Honey,1,40
Joe,2,34
Viky,3,56
I tried:
read -p 'enter a number= ' $num
cat class.csv | awk 'FS=",";if($3>$num){print$3}else{print "no matches"}'
if i enter 35
then output should be
40
56
And if i enter 100
then output should be
no matches
But this is giving me wrong output. Plz help me :(