Re:Learn to use Awk with hundreds of examples
by majewsky on Wednesday October 25, 2017 @11:01AM
(#15550668)
Let me golf this. :)
[ Parent
| on HN ]
Re:Learn to use Awk with hundreds of examples
by jcims on Wednesday October 25, 2017 @12:19PM
(#15551457)
This made me miss perl (but ya forgot $F[2]>240)
Re:Learn to use Awk with hundreds of examples
by majewsky on Thursday October 26, 2017 @05:44AM
(#15557529)
Ah, I was going by the snippet in the parent, not the original one in the grandparent. That here should do it:
perl -F: -anE '$_=$F[2];$t+=$_if$_>240}{say$t'
I wanted to be clever by doing `$t+=$_*($_>240)`, but that's actually one byte larger. :(