Leser: 2
9 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
5.0 2.08 9.496 23
10.0 2.08 5.917 39
10.0 2.08 5.917 39
15.0 1.02 6.823 75
20.0 1.01 14.810 80
20.0 1.01 14.810 80
25.0 1.61 27.117 37
30.0 1.61 71.563 72
30.0 1.61 71.563 72
1
2
3
4
5
6
7
8
9
10
11
12
13
open (in,"filter.txt")|| die "filter.txt file found!";
open (out,">filter_output.txt")|| die "filter_output.txt file found!";
my @array = <in>;
%ha = map{ $_, 1 }@array;
@array_u = keys %ha;
@array_u = sort keys %ha;
foreach(@array_u)
{
print out "$_\n"
}
close(in);
close(out);
1
2
3
4
5
6
7
8
9
10
11
12
10.0 2.08 5.917 39
15.0 1.02 6.823 75
20.0 1.01 14.810 80
25.0 1.61 27.117 37
30.0 1.61 71.563 72
30.0 1.61 71.563 72
5.0 2.08 9.496 23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#!/usr/bin/perl use strict; use warnings; my %seen; open my $out, '>', 'output.txt' or die $!; while( my $line = <DATA> ){ my ($id) = split /\s+/, $line; unless( $seen{$id}++ ){ print $out $line; } } close $out or die $!; __DATA__ 5.0 2.08 9.496 23 10.0 2.08 5.917 39 10.0 2.08 5.917 39 15.0 1.02 6.823 75 20.0 1.01 14.810 80 20.0 1.01 14.810 80 25.0 1.61 27.117 37 30.0 1.61 71.563 72 30.0 1.61 71.563 72
9 Einträge, 1 Seite |