I have a file like this
1 4 7 ... 2 5 8 3 6 9
And I would like to have as output
6 15 24 ...
That is the
Your answer is correct. It is just missed to print "sum". Try this:
awk '{sum+=$1;} END{print sum;}' infile > outfile