awk取字段中指定字符数量awk取字段中指定字符数量16 001agdcdafasd16 002agdcxxxxxx23 001adfadfahoh23 001fsdadggggg 得到: 16 00116 00223 00123 002 awk '{print $1,substr($2,1,3)}'awk 'BEGIN{FIELDWIDTH="2 2:3"}{print $1,$2}' a.txt