Sum the number in each line of a file

Here is the command

awk '{s += $1} END {print s}' mydatafile.txt

Leave a Reply

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.