1
2
3
4
5
Text text text text text 34,45
Text text text text 234
Text text text 345-347,532
Text text text text text text 445
usw.
1
2
3
4
5
Text text text text text ............... 34,45
Text text text text ...................... 234
Text text text ................... 345-347,532
Text text text text text text ............ 445
usw. ( die Zahlen sollten auf einer Line aufhören )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#!/usr/bin/perl use strict; use warnings; my ($text, $value); #23456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789| format = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>>>>>>>> dotize(65, $text), $value . sub dotize { my ($maxwidth, $string) = @_; return $string . " " . ('.' x ($maxwidth-length($string))); } foreach (<DATA>) { chop(); ($text, $value) = (m/^(\D+)\s(\d.+)/); $text = "" if !defined $text; $value = 0 if !defined $value; write(); } __DATA__ Text text text text text 34.45 Text text text text 234 Text text text 345-347,532 Text text text text text text 445