yes. but i have many columns. so i used htis instead of your style and didn't work. but it suppose to work ?
awk '{print $1?$2/$1:0}' OFMS='%0.2f' infile
yes. but i have many columns. so i used htis instead of your style and didn't work. but it suppose to work ?
awk '{print $1?$2/$1:0}' OFMS='%0.2f' infile
Try:
OFMT='%.2f'
not working
What isn't working?
$ awk '{print $1?$2/$1:0}' OFMT='%.2f' infile
11960.23
0.00
0
11.96
0
0
0
0
0
$ awk '{print $1?$2/$1:0}' infile
11960.2
1.19602e-07
0
11.9602
0
0
0
0
0
how about a file just contain multiple columns with values like this
2.0447e-05 2.13393e-05
2.15732e-05 2.02182e-05
1.85722e-05 2.11651e-05
I tried but not working
awk '{print $0}' OFMT='%.2f' file
Try:
awk '{print $1+0,$2+0}' OFMT='%.2f' file