Thread Zeilen Array als Spalten Array speichern (14 answers)
Opened by Tulkas77 at 2005-09-28 15:51

renee
 2005-10-04 14:17
#58441 #58441
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Wenn ich Deine Wünsche richtig interpretiert habe: (ungetestet)

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
#!/usr/bin/perl

use strict;
use warnings;

my $input = '/path/to/file';

print "Anzahl Zeilen: ";
chomp(my $numberOfFields = <STDIN>);
print "Spalte (Beginn): ";
chomp(my $start = <STDIN>);
print "Spalte (Ende): ";
chomp(my $stop = <STDIN>);

my $string = '';

open(my $fh,"<$input") or die $!;
while(<$fh>){
$string .= substr($_,$start-1,$stop-$start+1);
}
close $fh;

print $string;
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 Zeilen Array als Spalten Array speichern