-60 < x <= -30 ( 6273 pts) |**
-30 < x <= 0 ( 44623 pts) |********
0 < x <= 30 ( 55626 pts) +**********
30 < x <= 60 ( 11244 pts) |**
####
my $file = $ARGV[0]; # input file
my $bin = $ARGV[1]; # bin size normally 20 or 30
my $outfile = "temp.stat";
open (IN_LOG,"$file") || die "cannot open $file for reading: $!";
open (OUT_LOG,">$outfile") || die "cannot open $outfile for writing: $!";
my $colName;
my @array;
while () {
push (@array,$_);
}
}
my @sortArray = sort { $a <=> $b } @array;
$max = $sortArray[-1];
$min = $sortArray[0];
print OUT_LOG "#- - - - - - - - - - - - - - - - - - - - -\n";
print OUT_LOG "#MAX : $max \n";
print OUT_LOG "#MIN : $min \n";
print OUT_LOG "#- - - - - - - - - - - - - - - - - - - - -\n";
$temp=$max-$bin;
while ($max>=$min) {
$i=0;
print OUT_LOG "\n$max > $bin < $temp:";
foreach $val (@array) {
if($val<=$max && $val>=$temp) {
$i+=1;
}
}
$max= $temp;
$temp=$temp-$bin;
print OUT_LOG " $i pts ";
my $star = int($i/500) + 0.5;
$var= '*' x $star;
print OUT_LOG "| $var\n ";
}
close IN_LOG;
close OUT_LOG;
close MYFILE;
####
45.980
-34.99
89.00
35.87
75.00
-30.173
-40.178