in reply to Adding Leading Zeros

take a look at sprintf, especially at what "%010d" would resolve do.

-- Dan

updated: s/%10d/%010d/ per flounder99's post.

Replies are listed 'Best First'.
Re: Re: Leading Zeros.....Please Help
by flounder99 (Friar) on Sep 27, 2002 at 16:53 UTC
    Actually you would use "%010d" to get the leading zeros. This one-liner
    perl -ne 'printf("%010d\n",$_)'<numbers.txt
    will do the trick.

    --

    flounder