#!/usr/bin/perl

$note = 0;

while () {

    $line = $_;
    if ($line =~ /CDS\s+(?:complement\()?(\d+)\.\.(\d+)/) {
($o,$e) = ($1,$2);
$str = ($line =~ /CDS\s+complement/) ? "-" : "+";
$note = 1;
    };

    if ($line =~ /\/gene=\"(.+?)\"/ && $note == 1) {
printf "%s %d %d %s\n",$1, $o, $e, $str;
$note = 0;
    };

    if ($line =~ /\/note=\"(.+?)\"/ && $note == 1) {
printf "%s %d %d %s\n",$1, $o, $e, $str;
$note = 0;
    };

};

exit(0);