#!/usr/bin/perl use strict; use warnings; my @files = qw(BLUBBER1.txt BLUBBER2.txt BLUBBER3.txt BLUBBER4.txt); my $OUTPUT = 'ZIELgesamt.txt'; open(my $write_fh, '>', $OUTPUT) or die $!; for my $file(@files){ open(my $fh,'<',$file) or die $!; while(my $line = <$fh>){ $line =~ tr/\xa0//d; print $write_fh $line; } close $fh; } close $write_fh or die $!;