Hi,
how can i get the second data in the 4th column (ie "NP_047184. 1") if the data above that in the same column ("AAD12597.1 ") is what i have as my query data. as you can see that the second column has same numbers grouped together which means they are the same, but with different data in the 4th columns (ids). i have one of the ids, how can i get the other one?
thanks a lot.
here is how my input file (testfile) looks like (with space delimited):
how can i get the second data in the 4th column (ie "NP_047184. 1") if the data above that in the same column ("AAD12597.1 ") is what i have as my query data. as you can see that the second column has same numbers grouped together which means they are the same, but with different data in the 4th columns (ids). i have one of the ids, how can i get the other one?
thanks a lot.
here is how my input file (testfile) looks like (with space delimited):
Code:
9 1246500 - AAD12597.1 3282737 9 1246500 Provisional NP_047184.1 10954455 9 1246501 - AAD12599.1 3282739 9 1246501 Provisional NP_047186.1 10954457
Code:
my $infile='./testfile'; open(FH,$infile); while(<FH>){ if($_ =~ /^\d+\s+(\d+)\s+\-\s+($search)\./) { next; } if($_ =~ /^\d+\s+(\d+)\s+\w+\s+(\S+)\./) { $id=$1; print $id; exit; } }
Comment