#!/usr/bin/perl -w
open TXT1 , "<./ext_target_fasta.txt" or die "can't open file1:$!";

$out_file_1 = "./ext_target_gi.gid";
system "rm $out_file_1";
open OUT, ">>./$out_file_1";


while(<TXT1>)
{
	chomp;
    
	if($_=~ /^\>gi\|(\d+)\|.*/)
	{         

		print OUT "$1\t1\n";


	}
		
}


