I have a text file that has the following column data:
0.007
0.005
0.004
0.007
How do i output the total sum of the data above?
I have a text file that has the following column data:
0.007
0.005
0.004
0.007
How do i output the total sum of the data above?
Try this:
awk '{sum+=$1} END {print sum}' file
Try this:
cat file | awk '{ sum+=$1} END {print sum}'
You have won "Useless use of cat award"!!!!!
thanks all.
Thanks Rangarasan. I will take this as a part of motivation and correct my mistakes.
To err is human
All is well Good spirit