Normalize inputs in combine.pl
This commit is contained in:
parent
d5521c6bd2
commit
044a8b6dbb
1 changed files with 5 additions and 0 deletions
|
@ -5,14 +5,19 @@ use strict;
|
|||
sub loadFile {
|
||||
my ($file) = @_;
|
||||
my %ret;
|
||||
my $min = 100000000;
|
||||
open FILE,$file;
|
||||
while (<FILE>) {
|
||||
my ($addr,$p2h,$p8h,$p1d,$p1w,$p1m) = split(/\s+/,$_);
|
||||
if ($p1m =~ /\A([1-9.]+)%\Z/) {
|
||||
my $x = log($1*0.01)/log(0.5);
|
||||
$min=$x if ($x < $min);
|
||||
$ret{$addr} = $x;
|
||||
}
|
||||
}
|
||||
for my $k (keys %ret) {
|
||||
$ret{$k} -= $min;
|
||||
}
|
||||
close FILE;
|
||||
return \%ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue