Linux awk
1.1 awk脚本基本结构
awk 'BEGIN{ print "start" } pattern{ commands } END{ print "end" }' file
awk 'BEGIN{ i=0 } { i++ } END{ print i }' filename
awk -F ',' '{print $3}'
1.2 max
awk -F ',' 'BEGIN {max = 0} {if ($1>max) max=$1 fi} END {print "maxWTID=", max}' CV1.txt
1.3 min
min的初始值设置一个超大数即可
awk -F ',' 'BEGIN {min = 99999999999999} {if ($3<min) min=$3 fi} END {print "minWTID=", min}' CV1.txt