/home/telatin

a web notebook to store some memos…

Summing values from shell

leave a comment »

Suppose you have two or more text files with one value per line

File1:

0
1
4
20
2

If you want to sum them:

paste first.txt second.txt | awk '{ print $1+$2; }'

Written by proch

June 16, 2009 at 9:27 am

Posted in Uncategorized

Leave a Reply

You must be logged in to post a comment.