Adding Long List Of Large Numbers

Hi All,

I have a file with long list of numbers. This file contains only one column. These numbers are very large. I am using following command:

cat myfile.txt | awk '{ sum+=$1} END {print sum}'

The output is coming in scientific notation. How do I get the result in proper format?

Thanks
Angshuman

can u show the contents of the input file.

... whatever is the "proper format"...
For a non-scientific notation use printf and the %f conversion specifier, or set the OFMT variable accordingly.

Hi,

I have attached the file. For this file, when I run the command, I get the result as

cat myfile.txt | awk '{ sum+=$1} END {print sum}'
5.69169e+06

As said, use printf not print.