#!/usr/local/bin/perl -w # A program that accept an input file: Scorpion database from Gen Bank # and will output the database in BioWare format my $file1="$ARGV[0]" #var to save the input database my $result=">".$ARGV[1]; my $counter=1; open(INFO1,$file1) or die "Can't open $file1.\n";#open file1 open(OUT,$result) or die "Can't open $result.\n"; #foreach line in the files foreach() { if(/^DATE\s*(.*)-(.*)-(.*)/){ print 'DATE'."\t".'"'."$1-$2-$3".'"'."\n"; } elsif(/\s*\/intron=(.+)\n/) { my $item; my $local=$1; $local =~ s/\"//g; foreach $item (split('\;',$local)) { print "Intron\t \{Translation%$item\}\n"; } #end foreach } #end elsif elsif(/\s*\/exon=(.+)\n/) { my $item; my $local=$1; $local =~ s/\"//g; foreach $item (split('\;',$local)) { print "Exon\t", " \{Translation\%","$item\}","\n"; }#end foreach }#end elsif }