#!/usr/bin/perl

$file = @ARGV[0];
chomp(@ARGV);

foreach(@ARGV){

@con = ();
print "bereinige $_\n";

open(RH,"<$_") or die;
@con = <RH>;
close RH;

foreach(@con){
	if($_ =~ /^finame/){	
	s/%20//g;
	s/%E4/ae/g;
	s/%FC/ue/g;
	s/%C3%B6/oe/g;
	s/%C3%BC/ue/g;
	s/%C3%9F/ss/g;
	s/%C3%A4/ae/g;
	s/%F6/oe/g;
	s/%B4/'/g;
	s/%5B/[/g;
	s/%5D/]/g;
	s/%2B/+/g;
	s/%DF/ss/g;
	s/%2520/_/g;
	s/%A1//g;
	s/-/./g;
	s/ /./g;
	s/\?//g;
	s/\[//g;
	s/\]//g;
	s/\(//g;
	s/\)//g;
	#s/{//g;
	#s/}//g;
	s/\+//g;
	#s/\.//g;
	s/\!//g;
	}#ende von if
	if($_ =~ /^fname/){	
	s/%20//g;
	s/%E4/ae/g;
	s/%FC/ue/g;
	s/%C3%B6/oe/g;
	s/%C3%BC/ue/g;
	s/%C3%9F/ss/g;
	s/%C3%A4/ae/g;
	s/%F6/oe/g;
	s/%B4/'/g;
	s/%5B/[/g;
	s/%5D/]/g;
	s/%2B/+/g;
	s/%DF/ss/g;
	s/%2520/_/g;
	s/%A1//g;
	s/-/./g;
	s/ /./g;
	s/\?//g;
	s/\[//g;
	s/\]//g;
	s/\(//g;
	s/\)//g;
	#s/{//g;
	#s/}//g;
	s/\+//g;
	#s/\.//g;
	s/\!//g;
	}#ende von if
}
unlink $_;

open(WH,">$_");
print WH @con;
close WH;
}
