compile : perl prog.pl input.db result #!/usr/bin/perl my $input = $ARGV[0]; my $output = ">" . $ARGV[1]; my $counter=1; my $no='D000001'; open(INPUT, $input) or die "Can't open $input."; open(OUTPUT, $output) or die "Can't open $output."; $/="//\n"; while () { print "DBACC\t $no\n"; if ($_=~/^DATE\s*(.*-.*-.*)\s*\n/){ print "DATE\t $1\n";} elsif ($_=/^GenBank:(.*),\sEMBL:(.*),\sDDBJ:(.*)},\sSwissProt:(.*)\n/){ print "ACCESSION:GenBank\t ($1)\n"; print "ACCESSION:EMBL\t ($2)\n"; print "ACCESSION:DDBJ\t ($3)\n"; print "ACCESSION:SwissProt\t ($4)\n"; } print "Entry $counter\n"; $counter++; $no++; } close (INPUT); close (OUTPUT);