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
now i have used the following code to match 3rd and 11nth fields.
print "\n Enter the file name :>";
chomp( my $filename1 = <STDIN> );
open my $fh, '<', $filename1 or die "Cannot find the file $filename1:
push (@line, $_);
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 ne $st )
print $w $line [$i];
but howevr although its a tabdelimited file it gives me wrong output
i mean it also prints which have identical fields in 3rd and 11nth positions
is there any way to get rid of such error
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||