in reply to Padding strings for a flat file
sprintf("%10d", 1234) will give you "......1234" (those '.' are spaces, really, but PM formatting weirds it out).
sprintf("%010d", 1234) will give you "0000001234"
If you want x's instead, then try this (assuming you only have numerics and no strings)
If this doesn't work, there are format statements in perl, but my experience tells me there are rather cumbersome to use.$text = sprintf("%10d", $number); $text =~ s/\s/x/g;
|
|---|