[code=perl]
foreach my $x (sort keys %h_temp)
{
print OUTF2 $h_temp{$x};
chomp;
$data = substr($_,43,4) ;
$data2 = substr($_,54,4) ;
$data =~ s/\s+$//;
$data2 =~ s/\s+$//;
if($data eq " 601")
{
$mix = trim(substr($_, 25,17));
$h_loads{$mix} = $_;
}
if($data2 eq " 601")
{
$mix2 = trim(substr($_, 25,17));
$h_loads{$mix2} = $_;
}
}
foreach my $y (sort keys %h_loads)
{
print OUTF $h_loads{$y};
}
[/code]
Hi, I am having problem searching through my hash and pulling out specific column that matches my search. My hash $h_temp printed this out
and when I attemp to pull these column
it wouldn't print anything. Can someone show me what I did wrong?
Thank you,
TA
foreach my $x (sort keys %h_temp)
{
print OUTF2 $h_temp{$x};
chomp;
$data = substr($_,43,4) ;
$data2 = substr($_,54,4) ;
$data =~ s/\s+$//;
$data2 =~ s/\s+$//;
if($data eq " 601")
{
$mix = trim(substr($_, 25,17));
$h_loads{$mix} = $_;
}
if($data2 eq " 601")
{
$mix2 = trim(substr($_, 25,17));
$h_loads{$mix2} = $_;
}
}
foreach my $y (sort keys %h_loads)
{
print OUTF $h_loads{$y};
}
[/code]
Hi, I am having problem searching through my hash and pulling out specific column that matches my search. My hash $h_temp printed this out
Code:
'PAX MIT8 ', 645, 645,1.03375, -65.7583, 601 'PCHBTM 2 ', 25, 1,1.01000, -62.5354, 601 'ASH GRV8 ','O0',1, 645, 645, 15.830, 11.370, 601 'AUBURN 8 ','N0',1, 645, 640, 8.100, 1.900, 601
Code:
1.03375, -65.7583 1.01000, -62.5354 15.830, 11.370 8.100, 1.900
Thank you,
TA
Comment