#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;

my $type = shift;
my $fh   = shift;

open I, "< $fh" or die "can t open $fh\n";
while(<I>){
  chomp;
  my @F=split"\t",$_;
  if (m/^id/ && $.==1){
    $F[0]='ID';
    $F[1]='Desc';
    print join("\t", @F)."\n";
  }
  else{
    if($F[1] eq $type){
      $F[1]=$F[0];
      print join("\t", @F)."\n";
    }
  }
}
close I;
