> -----Original Message-----
> From: VUNETdotUS [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 17, 2007 12:36
> To: [email protected]
> Subject: Format Output
>
> I print some output in PERL. It is data in 3 columns. I use \t to add
> a tab space to make a column.
> However, \t may not produce the desired result. If the value is short
> in length, next column is not aligned correctly in the row. Something
> like this:
>
> 123 12345 123456
> 123 12345 123456
> 1 1234 123456
> 123 12345 123456
>
Use tmax size you want but right justify as in %4s or %4d for
the first column, want some space then add space, but then use %5d or s
and repeat the process. Could look something like:
'%4d %5s %6s\n" or "%4d %5d %6d\n"
Depends on what you are after, but this should be a start.
Wags ;)
David R Wagner
Senior Programmer Analyst
FedEx Freight
1.408.323.4225x2224 TEL
1.408.323.4449 FAX
http://fedex.com/us
> How can I make a nicely formatted output?
> Thanks
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>
**********************************************************************
This message contains information that is confidential and proprietary to FedEx
Freight or its affiliates. It is intended only for the recipient named and for
the express purpose(s) described therein. Any other use is prohibited.
**********************************************************************
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/