my (%hash, %hoa); my (@data_array,@begriff_array); while(<>){ chomp; my $bez1=$1, my $bez2=$2, my $dis=$3 if(/^(.+)\t(.*)\t(.*)$/); push @{$hash{$bez1}}, $dis; next if defined $hoa{$bez1}; push @begriff_array, $bez1; $hoa{$bez1}=1; } foreach my $key (sort keys %hoa){ push @data_array, [@{$hash{$key}}]; }