我有此文件在CSV文件與AWK替換列值
error.log中
[00:00:00.284],501,
[00:00:00.417] ,5,5294100071980
[00:00:02.463],501,
[00:00:05.169],501,
[00:00:05.529],501,
[00:00:05.730],501,
所以,如果字段$ 3其空我想打印 「沒有價值」
我試着這個代碼
awk '{{FS=","} if($3=="") {print $1,$2,"No value"}}'
但它打印
>[00:00:00.284] 501 No value
>[00:00:02.463] 501 No value
>[00:00:05.169] 501 No value
>[00:00:05.529] 501 No value
>[00:00:05.730] 501 No value
>[00:00:07.193] 501 No value
>[00:00:09.899] 501 No value
>[00:00:31.312] 501 No value
你真的在輸入文件中的每個真實數據行之間有空行? –