[root@waptx126 tmp]# cat a.txt
5555,123456,0,0,555,0,0,0,
5545,123456,0,0,555,0,0,0,
5525,123456,0,100,555,0,0,0,
5655,122456,0,0,555,0,0,0,
5655,122245,0,0,555,0,0,0,
5655,172456,0,0,555,0,0,0,
5655,152456,0,0,555,0,0,0,
5555,123456,0,100,555,500,10,200,
5555,123456,0,0,555,500,0,0,
5555,123456,0,0,555,0,0,2000,
[root@waptx126 tmp]# cat a.txt |awk -F, '$3!~/^0$/ || $4!~/^0$/ || $7!~/^0$/ || $8!~/^0$/ {print $0}'
5525,123456,0,100,555,0,0,0,
5555,123456,0,100,555,500,10,200,
5555,123456,0,0,555,0,0,2000,
在Linux中有个文件,大约有上百行,每行以“,”为分隔符,共有8列,我需要取出其中第3,4,7,8列不为零的整行。
阅读(1019) | 评论(0) | 转发(0) |