while(){ chomp; if(/^>(\w+)\s\w+\=(chr\w+)\:(\d+)\-(\d+)/) $loc{$1} = "$2:$3:$4:$5"; print $loc{$1}."\n"; } }