Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个这样的 CSV 文件(100 列)
10,20,30,40,50,...,1000 20,30,40,50,60,...,1010 . . .
我想将所有值除以 10,这样我就可以得到
1,2,3,4,5,...,100 2,3,4,5,6,...,101 . . .
我怎样才能用 AWK 做到这一点?非常感谢!
使用以下 awk 命令:
awk 'BEGIN {FS=OFS=","} {for (i=1; i<=NF; i++) $i/=10;}1' infile