Reputation: 924
I've got a file containing decimal values formatted like 9.85E-4
. How can I make awk format this value to 0.000985
?
Upvotes: 0
Views: 100
Reputation: 289535
Use printf
with the %f
option:
awk '{printf "%f\n", your_field .... }' file
$ cat a
9.85E-4
23
$ awk '{printf "%f\n", $1}' a
0.000985
23.000000
From The GNU Awk User’s Guide # 5.5.2 Format-Control Letters:
%e, %E
Print a number in scientific (exponential) notation.
%f
Print a number in floating-point notation
Upvotes: 4