I want to subtract a column from 100 using awk. I have tried
awk '{ t = 100-$2 } END { print t }' /alps/average.log
It gave me only the last value subtracted. How it can be accomplished if I want the whole column outputted on terminal?
I want to subtract a column from 100 using awk. I have tried
awk '{ t = 100-$2 } END { print t }' /alps/average.log
It gave me only the last value subtracted. How it can be accomplished if I want the whole column outputted on terminal?
print t
in an unlabeled block, definitely not in one labeled END
!
Try this:
awk '{print 100-$2}' /alps/average.log
Commands after the END
label are executed only after end of file.