use strict; use warnings; open my $in, '<', 'out1.txt' or die $!; open my $out, '>', 'out.txt' or die $!; while(my $line=<$in>) { my @elemts=split(/\s+/,$line); if(@lements > 5) { print $elemts[5]."\n"; } else { print "keine Werte\n"; } } close($in); close($out);