#!/usr/bin/perl use strict; while( ) { if ( /\s+\w+\s+\d+\.\.\d+/ ... /\"GeneID:\d+\"/ ) { print "$1 $2 $3" if ( /\s+(\w+)\s+(\d+)\.\.(\d+)/ ); print " $1" if ( /\/(gene=.*)/ ); print " $1" if ( /\/(transcript_id=.*)/ ); print "\n" if ( /\"GeneID:\d+\"/ ); } }