我有一個文件log.txt,其格式如下所示。從文件第二列中刪除0.0
log.txt的
280,249.999441
140,0.0
140,0.0
84917,182.59465
140,0.0
72161,185.615882
304,249.998589
280,240.184619
我想刪除所有在第二列0.0項。
預期輸出:
280,249.999441
84917,182.59465
72161,185.615882
304,249.998589
280,240.184619
我想要做上述的簡單和最快的方式。我對所有工具都開放。
感謝
不檢查,如果它是第2列,雖然匹配,將需要像'grep -v'^ [^,] *,0 \ .0 $'' – Sundeep
它確實檢查。試試:'echo「0.0,42」| grep -v'0 \ .0 $'' – languitar
如果在第二列出現'0.0'時有3列,那該怎麼辦?我的建議應該是'grep -vE'^ [^,] *,0 \ .0(,| $)'' – Sundeep