Thread Namen aus String extrahieren
(11 answers)
Opened by hugenyn at 2011-04-05 12:50
Tja, ich sollte meinen Code auch testen :-). So gehts:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 use Data::Dumper; while (<DATA>) { my ($name, $date, $rest) = split /\s+(\d{4})\s+/, $_, 3; my @rest = split ' ', $rest; print Dumper [$name, $date, @rest]; } __DATA__ Name1 2005 5 112 165 198 287 814.7 910 Name2, W. 2005 4 127 162 193 279 314 430 Name3 Vorname 2006 8 110 192 282 314.3 870 |