Hi Gurus
Mi Name is Raul and I've this little problem with awk.
I'm trying change the data format within an ascii file
from this (floating,exponential or scientific):
#
#
#
0.57210E+06 0.21808E+07 0.10000E+31
0.57210E+06 0.21807E+07 0.10000E+31
0.57210E+06 0.21780E+07 -3736.9
0.57210E+06 0.21779E+07 -3750.0
0.57210E+06 0.21778E+07 -3763.6
0.57210E+06 0.21777E+07 -3779.9
.
.
.
to decimal, using this:
#!/bin/awk -f
NR<3 {
print
}
NR>=3 {
printf "%12.2f %12.2f %12.2f\n", $1, $2, $3
}
But this is what I get:
#
#
#
572100.00 2180800.00 1000000000000000019884624838656.00
572100.00 2180700.00 1000000000000000019884624838656.00
572100.00 2178000.00 -3736.90
572100.00 2177900.00 -3750.00
572100.00 2177800.00 -3763.60
572100.00 2177700.00 -3779.90
It should be:
1000000000000000000000000000000.00
Not:
1000000000000000019884624838656.00
Does anyone knows why ??
Mi Name is Raul and I've this little problem with awk.
I'm trying change the data format within an ascii file
from this (floating,exponential or scientific):
#
#
#
0.57210E+06 0.21808E+07 0.10000E+31
0.57210E+06 0.21807E+07 0.10000E+31
0.57210E+06 0.21780E+07 -3736.9
0.57210E+06 0.21779E+07 -3750.0
0.57210E+06 0.21778E+07 -3763.6
0.57210E+06 0.21777E+07 -3779.9
.
.
.
to decimal, using this:
#!/bin/awk -f
NR<3 {
}
NR>=3 {
printf "%12.2f %12.2f %12.2f\n", $1, $2, $3
}
But this is what I get:
#
#
#
572100.00 2180800.00 1000000000000000019884624838656.00
572100.00 2180700.00 1000000000000000019884624838656.00
572100.00 2178000.00 -3736.90
572100.00 2177900.00 -3750.00
572100.00 2177800.00 -3763.60
572100.00 2177700.00 -3779.90
It should be:
1000000000000000000000000000000.00
Not:
1000000000000000019884624838656.00
Does anyone knows why ??