#!/usr/bin/perl -w

#decided to have input file entered in command line



#####INPUT Name of blast output file  ############# 

unless(@ARGV==1) {die "please provide genome name in command line \n  
file should contain multiple sequences in fasta format \n 
a file with the ptt table should be in the same directory\n\n";}

$filename=$ARGV[0];  

open(IN, "< $filename") or die "cannot open $filename:$!";

##################################################


while (defined ($line=<IN>)){

if($line=~"#"){
	#skip the line, since it is a comment line
	#copy line to OUT
	#print OUT "$line";
	#if you want to keep comment lines un comment the last line
    }
    else { # read through file line by line

 		@result=($line =~ m/gi\|(\d+)\|/g); #match gi|numbers capture numbers in $result[1] and $result[2]
  		
 		print "$result[0] and $result[1] \n";
 		
	};

}								
close(IN);
