- Original Message -
From: "Geoff Ellis" <[EMAIL PROTECTED]>
To: "Unix (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 9:59 AM
Subject: [Perl-unix-users] silly question...
> could someone tell me how to pad right to left with spaces in
Hrmmm ... need some more details - are you always expecting to put 4 0's at
the end? If so, it would be a simple:
$data = '001023';
sprintf ( "%s", $data );
Don't use %d in the printf() - that will strip away the leading 0's.
Jason
If memory serves me right, on Monday 21 January 2002 09:
this helps?
TK im /u2/dbs> perl -e 'printf "%-10sblabla","001023";'
001023blabla
same with sprintf with regard to the format
till
> could someone tell me how to pad right to left with spaces in a srintf
> function..
> ie. how to convert "001023" into "001023" where s is a space..
>
> t
could someone tell me how to pad right to left with spaces in a srintf
function..
ie. how to convert "001023" into "001023" where s is a space..
tia Geoff
___
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mail