Hell friends,
I wrote a script gets the summation of particular column using awk.
The awk output is given in scientific notation. How do I convert the scientific notation to normal.
My awk syntax : awk '{sum += $2} END { printf sum }' temprep.txt
Out put is like 1.5365e+07
I want it as 15365000
Please give me a suggestion.
Thanks
Mahesh
When I check man awk in Solaris it says there is a built in variable called OFMT that controls the output format of numbers. You could try setting that to a different format. Also, it says after the printf you can specify the format, check man printf for details on that. I would guess printf %8d sum would work for your example.
exactly,
awk '{sum += $2} END { printf ("%8d\n", sum) }' temprep.txt