Thread Datei durchsuchen und Filtern (6 answers)
Opened by Arasiel at 2004-12-22 11:35

renee
 2004-12-22 12:36
#50291 #50291
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Wieso definierst Du Dir nich nen neuen "Blocktrenner":
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/perl

use strict;
use warnings;

my $file = '/path/to/file.txt';
my @entries;

{
local $/ = "---------end}\n";
open(FILE,"<$file") or die $!;
while(my $entry = <FILE>){
push(@entries,$entry);
}
close FILE;
}

foreach my $entry(@entries){
my ($start) = $entry =~ /(.{24})----------{ begin/;
my ($end) = $entry =~ /(.{24})--------------------- end }/;
}
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 Datei durchsuchen und Filtern