|
Zero padding
How can I add zero pad a number based on a variable length so that the length of the number is always the same?
Example:
00004
00023
34243
Always has a length of 5 with zeros added in when necessary
Edit: nm i found out how using seq -w
anyways, i have another question about %04d . Instead of using 4 for the digits, how could I make 4 be a variable instead? Would %0$(length)d work instead?
__________________
~ Silicon Enhanced Pudding
"It's magically delicious"
Last edited by Silicon_Pudding; Feb 17th, 2007 at 12:25 PM.
|