in reply to to print l columnwise and subtraction

An awk solution

awk 'NR==1{max=0.70 * $3}(($5-$4) > max) { print }' filename


~suhail

Replies are listed 'Best First'.
Re^2: to print l columnwise and subtraction
by vis1982 (Acolyte) on Jul 21, 2010 at 09:44 UTC
    Thanx other question is like tht same kind

    aa 22 310 1 300

    ab 40 200 2 228

    ac 100 270 10 241

    df 23 240 22 180

    ef 100 270 24 282

    gh 24 125 22 190

    Output should be not the maximum present in the third column but if $2 cloumn is 100 then take third column is 270 then 70% of $5-$4 > $3 (when it is 100 in the 2nd column)

    awk '{if ($2=="100") print $3}' aaq | uniq -c |awk '{print $2}'

    How to write in one line

     awk '{if ($2=="100") max=0.70 * $3}(($5-$4) > max) { print }' $file Tht code written is right??