Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to addup column from two files ?

Status
Not open for further replies.

netbackup1234

Programmer
Aug 27, 2006
24
US
Hi
I have two file ..
$ cat ora1
PARSCMG1TDP 1.100
PARSDB01_TDP 2.200
PARSDB02_TDP 1.401

$ cat ora2
PARSCMG1TDP 1.100
PARSDB01_TDP 2.200
PARSDB03_TDP 17.069

Then print third file which will print common entry from 1st column and add up second column like
$cat thirdfile
PARSCMG1TDP 2.200
PARSDB01_TDP 4.400


 
And what have you tried so far ?
Tip: you may consider awk's associative arrays ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top