The GNU Awk User's Guide

有一列数
0.40
0.10
0.08
0.06
0.05
0.05
0.03
。。。
我想得到累到到第几行时其值大于0.60,并获得该值,为4


awk '{s+=$1}s>0.6{print NR;exit}' urfile


I think I must know about the AWK.So I got a Awk user's guide.

here:  The GNU Awk User's Guide.
posted @ 2009-03-25 21:05  冷月X  阅读(160)  评论(0编辑  收藏  举报