这个又是在论坛看的 自己只是记录
数据是这样的:"20111020","041172","14921","00000917","A44021", "20111020","041172","14921","00000917","A44021","038636","6226820014901178461","010000","0200",200.00,"0" "20111020","041180","14306","00000727","A38012","087503","6226820014301551069","010000","0200",500.00,"0" "20111020","041192","13109","00000273","A26005","028660","6226820013101423560","010000","0200",200.00,"0" "20111020","041243","17725","00000692","A72011","089741","6227002112280080817","010000","0200",1000.00,"0" "20111021","041172","14921","00000917","A44021","038636","6226820014901178461","010000","0200",200.00,"0" 里面含有不全的数据。 现在想得到的结果是第一列和第二列要唯一的数据,并且删除不全的数据,这样命令要怎么写??
sort -t"," -k1 -k2 -u t2 |awk -F "," 'NF == 11 {print $0}'
sort相关参数详细用途参考http://www.xiaoxiaozi.com/2009/12/01/1652/