Thread split geht nicht: steh mal wieder im wald (11 answers)
Opened by sabrina at 2006-09-20 13:39

renee
 2006-09-20 14:53
#70081 #70081
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

use strict;
use warnings;

my $file = 'KNAPP_2005.txt';
my $files = 'knappziel_1_3.txt';
my @lines;

open(my $fh,'<',$file) or die $!;
while(my $line = <$fh>){
chomp $line;
my @line = (split(/[\s\:\\]+/,$line));
if ($line =~/\bfast\b/){
push(@lines,\@line);
}
}
close $fh or die "kann nicht schliessen$!"

print $_ for (@lines);

open(my $w_fh,'>',$files) or die $!;
print $w_fh join(";",@$_),"\n" for (@lines);
close $w_fh or die "kann nicht schliessen $w_$!";
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread split geht nicht: steh mal wieder im wald