I want extract particular strings from large file(file size 600 Mb). I gave two kind of conditions for identify the position. first string comparison is working, but second one is not working. Please helpm in this. Thanks in advance.
Expand|Select|Wrap|Line Numbers
- open(NGS,"<$ngs") || die "can't open file";
- open(RESULT,">$output") || die "can't open file";
- @ngs_seq = <NGS>;
- $NGS_length = @ngs_seq;
- $z=0;
- for($j = 0; $j <= $NGS_length; $j++)
- {
- $fastasymbl= substr($ngs_seq[$j], 1, 1);
- if($fastasymbl eq '>')#1st working
- {
- ($a1, $b1, $c1, $d1, $e1, $f1)=split(/\|/, $ngs_seq[$j], 6);
- #chomp $b1;
- # $b1=~s/\s//g;
- if($b1 eq 'A 0 1')#2nd not working
- {
- print "$b1\n";
- $z++;
- }
- }
- }
- print "\n total number of scaffolds: $z\n";
- close NGS;