in reply to Array reference

I see your input and output, what script have you written to try to produce that output ?

Please post your script. If you don't have one, don't expect someone to just write one for you. There are sites where you can hire someone to write Perl script to your specifications. But you have to pay them.

Dyslexics Untie !!!

Replies are listed 'Best First'.
Re^2: Array reference
by rkk (Novice) on Jun 12, 2013 at 22:52 UTC

    well.. I also know that no body wants to write a code for free.. I have asked for the help not for the entire code..

    #!/usr/bin/perl use strict; open (FILE, "ip.txt") || die "can't: $!"; open (OUTPUT,">op.txt") || die "can't: $!"; my @lines=(); my @l1=(); my @l2=(); @lines=<FILE>; my %hash=(); my $i=0; my $j=$i+1; my @arr1=(); my @arr2=(); my @arr3=(); while($j <= $#lines) { #print "$j\n"; @l1=split(/\t/,"$lines[$i]"); @l2=split(/\t/,"$lines[$j]"); if(abs($l2[3]-$l1[3]) <= 500 && $l1[6] eq $l2[6]) { $hash{$lines[$j]}=1; if(!exists $hash{$lines[$i]}) { $hash{$lines[$i]}=1; push(@arr1,$l1[3]); push(@arr2,$l1[7]); push(@arr3,$lines[$i]); #print OUTPUT "$lines[$i]"; } #print OUTPUT "$lines[$j]"; push(@arr1,$l2[3]); push(@arr2,$l2[7]); push(@arr3,$lines[$j]) } else { @s_arr2=sort{$a<=>$b}@arr2; if($s_arr2[-1]-$s_arr2[0] <= 500) { //got struck $i=$j; $j=$i+1; }

    Thanks.