why is the seek function not fetching the content but the position? thanks !!!file1: SID834.56 AGAAGTCGTACGATCA SID164.26 AGTCGATCATTATATATTCGCTAG SID4.56 AGCTAGCGATCGATCCCCCCCCCCCCCCCC SID5764.12 CGATCGATC SID564.12 ACGAATATGATAC file2: cluster number 1: (reads count:2) SID834.56 SID564.12 cluster number 2: (reads count:2) SID164.26 SID5764.12 cluster number 3: (reads count:1) SID4.56 code: #!/usr/bin/perl -w use strict; use warnings; open(FH1,$ARGV[0]) or die "can not open\n"; open(FH2,$ARGV[1]) or die "can not open\n"; my @indx; while(<FH1>){ my ($id,$seq)=split("\t",$_); push(@indx, "$id\t".tell FH1); } while(<FH2>){ if($_=~m/^clus/){ my $clushead=$_; print "\n$clushead"; } else{ $_=~s/\t//g;$_=~s/\n//g; my $tes=$_; my @hit=grep(/$tes/,@indx); my $sca="@hit"; my ($id1,$pos)=split("\t",$sca); print sysseek (FH1,$pos,0),"\n" or die "seek:$!"; } } desired results: cluster number 1: (reads count:2) SID834.56 AGAAGTCGTACGATCA SID564.12 ACGAATATGATAC cluster number 2: (reads count:2) SID164.26 AGTCGATCATTATATATTCGCTAG SID5764.12 CGATCGATC cluster number 3: (reads count:1) SID4.56 AGCTAGCGATCGATCCCCCCCCCCCCCCCC results which i get now: cluster number 1: (reads count:2) 27 146 cluster number 2: (reads count:2) 62 122 cluster number 3: (reads count:1) 101
In reply to seeking help for seek function by pearly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |