My file is as below I want to display those records of students whose percentage is above 80.
Studid StudName Asp.Net DBMS Unix
1 Ani 75 62 80
2 George 90 95 82
3 Jake 45 30 40
4 Dennie 89 92 90
so i used following code
awk '(($3+$4+$5)/3)>80 {print}' stud
it works.. But i want to assign these columns into variable and then want to display output. So i tried below code but it didn't work
awk 'total=$3+$4+$5, per=total/3, per>80 {print}' stud
any solution with variables?
awk 'NR==1 || ($3+$4+$5)/3 > 80' stud
looks simple and easy... – Sundeep 12 hours ago