user1026822
user1026822

Reputation:

how to i add two columns in Awk Ubuntu that are strings(which are integers)?

I am trying add two columns in a text file that are seperated by tabs. I need to use awk to do this. They are two integers that i need to add.

Upvotes: 3

Views: 11732

Answers (1)

Adrian Cornish
Adrian Cornish

Reputation: 23866

This should work

awk '{ print $1+$2; }' file.txt

Upvotes: 7

Related Questions