I want to print all those line in which mp_demand>1 . I am using awk for this, but somehow not able to achieve that.
root@1.2.3.4:#cat a.txt
Target MR 11604 MPG: -1 Region: -1
reading assignments message /a/tmp/a.txt
mpg=1 mrule=11604 reg=33000 score=10625 rank=0 perc=100 mp_demand=1
mpg=2 mrule=11604 reg=33000 score=10625 rank=0 perc=100 mp_demand=1
mpg=3 mrule=11604 reg=33000 score=10625 rank=0 perc=100 mp_demand=1
mpg=4 mrule=11604 reg=33000 score=10625 rank=0 perc=100 mp_demand=1
mpg=5 mrule=11604 reg=33000 score=10625 rank=0 perc=100 mp_demand=1
mpg=6 mrule=11604 reg=33000 score=10625 rank=0 perc=100 mp_demand=34
What I am trying is
root@1.2.3.4:# cat a.txt | awk 'BEGIN {p=0} $7 >= 0 {p ++} END {print p}' | head
45877
However, the expected output I want is
mpg=6 mrule=11604 reg=33000 score=10625 rank=0 perc=100 mp_demand=34
any other/better ways of doing it?