#!/bin/perl # for each location in column 4 sum the amount of column 3 # block 0x000af9a8 0x00000040 0x0001ddf3 0x00000000 # block 0x000afd88 0x00000040 0x0001ddf3 0x00000000 while(<>) { chomp(); @f = split(); $v= hex($f[2]); $tot{$f[3]} += $v; $count{$f[3]} ++; } foreach $k (keys %tot) { print "src($k);\t// $tot{$k}\t$count{$k}\n"; $sum += $tot{$k}; } print "// $sum\n";