Created
February 21, 2015 19:10
-
-
Save phonyphonecall/964c8bfb00f5e346c525 to your computer and use it in GitHub Desktop.
Produces all the data in specified bin on stdout. Cat stdout to file and use in your favorite plotting program.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
open(my $fd, "<", $ARGV[0]) or die "cannot open file $!"; | |
my $max = -1; | |
my $count = -1; | |
while(<$fd>) { | |
$count++; | |
next if $count == 0; | |
my @line = split("\t", $_); | |
if ($max < $line[1]) { | |
$max = $line[1]; | |
} | |
} | |
seek($fd, 0, 0); | |
$count = 0; | |
while(<$fd>) { | |
$count++; | |
next if $count == 0; | |
my @line = split("\t", $_); | |
no warnings 'numeric'; | |
my $temp = $line[1] * 1.0000000; | |
if($temp > 0.001 * $max and $temp <= $max) { | |
print "$line[0]\t$temp\n"; | |
} | |
} | |
close($fd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
chmod 755 {script_name}
./{script_name} {path_to_sa_log}