1
在CSV文件我有欄下面我試着用
的CSV文件列計算
$ awk -v FS="\",\"" -v OFS="\",\"" '{$2=sprintf("%.2f",$2*2)}1' file.csv
改變第二列的值,但某些列包含字符串,它必須保持不變。我知道
"^[0-9][0-9]*$"
將檢查它是否數字,但如何把它在我的命令結合?
FILE.CSV
"sku","NO price","supplierName"
"sku","3.14","supplierName"
"sku","3.56","supplierName"
"sku","4.20","supplierName"
[檢查此答案](http://unix.stackexchange.com/questions/131073/awk-printf-number-in-width-and-round-it-up) – anubhava
請發一個新的問題rounding of這個問題的浮點數是識別數字。 – anubhava
謝謝,它工作 – user5507230