#!/usr/bin/perl use strict; use warnings; my @files = qw(BLUBBER.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; my @array = (split /[\t\s\\]+/, $line)[0..7]; my $x = pop @array; if ($x =~ /\./) { pop @array; my $y = pop @array; $array[-1] .= $y; } else { pop @array; pop @array; } $array[-1] = sprintf('%.3f', $array[-1] / 1024); print $write_fh join(';',@array),"\n"; } close $fh; } close $write_fh or die $!;