#! /usr/bin/perl

chomp(my $file = $ARGV[0]);
my @temp = split(/\./, $file);
my $pfam_name = $temp[0];

open(OUT, ">tempfile");
open(IN, $file) or die "cannot open file\n";
while(!eof(IN)){
  chomp(my $line = <IN>);
  if($line =~ /# query sequence file:/){
	print OUT "# query sequence file:             $pfam_name\n";
  }
  elsif($line =~ /# target sequence database:/ ){
	print OUT "# target sequence database:        SCOP-NrichD database\n";
  }
  elsif($line =~ /# output directed to file:/ ){
  }
  elsif($line =~ /# per-dom hits tabular output:/ ){
  }
  else {print OUT "$line\n";} 
}
close IN;
close OUT;

system("mv tempfile $file");
