Hi all,

Need a little help on summarising 2 different tables into 1, based on a particular 
field.

The 2 tables (they are actually content from a log file) look like the follow :

Table #1
------------
1006788900 198 36
1006788600 29 35
1006788300 18 75
1006788000 19 65
1006787700 42 37
1006787400 29 26
1006787100 65 84
1006786800 6 87

Table #2
------------
1006789500 43 47
1006789200 23 64
1006788900 198 36
1006788600 29 35
1006788300 18 75
1006788000 19 65
1006787700 42 37
1006787400 29 26

They may not be of equal length. The first field is TIME, 2nd is INPUT and 3rd is 
OUTPUT. Basically, what I want to do is to summarise the table based on the first 
field (TIME). For example, if both tables have TIME as 1006788600, INPUT and OUTPUT 
from both tables whose TIME is 1006788600 will be summed up. Meaning the script needs 
to go thru the tables to look for entries with the same TIME, and add the INPUT and 
OUTPUT together to form another summaried table.

Any easy way for me to do that other than putting the data into an array or hash 
table, and compare them entry by entry??

Any help is appreciated. Thanks in advance.

Reply via email to