~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/script/merge_cdfs.pl

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
my %rows;  # val -> [ count1, count2, ... ]
 
4
 
 
5
my $filen = 0;
 
6
for my $file (@ARGV) {
 
7
    open(I,"$file");
 
8
    while (<I>) {
 
9
        next if /^\#/;
 
10
        chomp;
 
11
        my ($v, $c) = split(/\t/,$_);
 
12
        $rows{$v}->[$filen] = $c;
 
13
    }
 
14
    $filen++;
 
15
}
 
16
 
 
17
for my $v (sort {$a <=> $b} keys %rows) {
 
18
    print "$v";
 
19
    for (my $i=0; $i < $filen; $i++) {
 
20
        print "\t" . int($rows{$v}->[$i]);
 
21
    }
 
22
    print "\n";
 
23
    #print join("\t", $v, @{$rows{$v}}) . "\n";
 
24
}