Leser: 1
|< 1 2 >| | 12 Einträge, 2 Seiten |
/^([^.]+)\./
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use warnings; use strict; while(my $zeile = <DATA>) { my @array = (); @array = split(/\./, $zeile); print join("\n", $array[0])."\n"; } # while __DATA__ Auto.VW.Golf.BJ Auto2.VW.Polo.BJ Auto3.Audi.A5.BJ Auto4.Audi.A4.BJ Auto5.Audi.A3.BJ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/perl -l use strict; use warnings; while my ( $line = <DATA> ) { my $field1 = ( split /\./, $line, 2 )[0]; print $field1; } __DATA__ Auto.VW.Golf.BJ Auto2.VW.Polo.BJ Auto3.Audi.A5.BJ Auto4.Audi.A4.BJ Auto5.Audi.A3.BJ
topeg+2008-11-21 21:58:08--
print join("\n", $array[0], $array[2]."\n"; # zB
print OUTFILE "$1;$2;$3;$4\n";
1
2
3
4
5
6
7
8
9
10
11
# ...
# zeilenweises lesen
chomp $line;
my @elements = split / /, $line;
# verarbeite @elements
print OUTFILE join ';', @elements;
# ...
|< 1 2 >| | 12 Einträge, 2 Seiten |