Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
hii
i mean it also prints which have identical fields in 3rd and 11nth positions
is there any way to get rid of such error
i have a file that contains each line smthg like this
4829:71370 1:N:0:CGATGT + chr6 126912761 GAAGGCATAGCCCGTTGGGCTGTGGTCATCAGCCTC CCCFFFFFHGHHHJHIJJJHIJIGHCGIIJJJJIJI 0 4829:71370 2:N:0:CGATGT + chr7 89349071 AGCCCTGCCCCCACCCCCCATTCTTCTTGACTGTCT C@@FFFFFHHHGHJ
JIJIJIIIIJJJJJJJJIIJIJ 0
now i have used the following code to match 3rd and 11nth fields.
but howevr although its a tabdelimited file it gives me wrong outputprint "\n Enter the file name :>"; chomp( my $filename1 = <STDIN> ); open my $fh, '<', $filename1 or die "Cannot find the file $filename1: +$!"; while (<$fh>) { push (@line, $_); $count++; } open my $w, '>', 'Result.txt' or die "Cannot open the file Result.txt: + $!"; for ($i = 0; $i < $count; $i++) { @st = split ("\t", $line [$i]); if ($st[3] ne $st [11]) { print $w $line [$i]; } } close $w; close $fh;
i mean it also prints which have identical fields in 3rd and 11nth positions
is there any way to get rid of such error
|
---|
Back to
Seekers of Perl Wisdom