@lines=; for($i=0;$i<=$#lines;++$i) { # Block Aircraft Registration #$aircraftregistration=substr($lines[$i],7,5); # Block Departure Airport # $departureairport=$zeile1[4]; # $departureairport=substr($lines[$i],23,4); # Block Destination Airport # $destinationairport=substr($lines[$i],28,4); # Block Datum $day1=substr($lines[$i],33,2); $month1=substr($lines[$i],35,3); $year1=substr($lines[$i],38,4); if ($month1 eq "SEP"){ $month="09" } # Block Zeit der Messung $hr=substr($lines[$i],42,2); $min=substr($lines[$i],44,2); $sec=substr($lines[$i],46,2); # Block Zeit Empfang der Messung $hr1=substr($lines[$i],49,2); $min1=substr($lines[$i],51,2); $sec1=substr($lines[$i],53,2); # Block Koordinaten # $lat=substr($lines[$i],57,7); #$long=substr($lines[$i],64,7); # Block Höhe in Zehntel # $fl=substr($lines[$i],71,4); # Block Temperatur # $sign=substr($lines[$i],75,1); # $temp=substr($lines[$i],76,3); #if ($sign eq "P"){ $sig=" " #} #if ($sign eq "M"){ $sig="-" # } # Block Wind $dir=substr($lines[$i],79,3); # $vel=substr($lines[$i],82,3); # Bestimme UNIX Zeitstempel $TIME = timelocal($sec, $min, $hr, $day1, $month-1, $year1-1900); for my $line (@lines) { chomp $line; my ($TIME, $dir) = split ' ', $line; $values{$TIME}->{count}++; $values{$TIME}->{value1_sum} += $value1; } for my $TIME (keys %values) { my $value1_sum = delete $values{$TIME}->{value1_sum}; $values{$TIME}->{value1} = $value1_sum / $values{$TIME}->{count}; } print $TIME," ",$dir,"\n";