Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alignment of info

Status
Not open for further replies.

newtarge

ISP
Oct 27, 2003
21
US
I have a situation where I'm getting the file sizes from a directory using du -ks and I split the line into numbers and directories. In the variable representing the numbers they are all left aligned and I want them to be right aligned. how do I do this ?
 
Perl should just have scalar values and you should be able to align them on output, if you split on whitespace that is.
 
This variable contains a list of file sizes.


ex.

123
24
2
93
90032
110

I want it be

123
24
2
93
90032
110
 
Use sprintf()

It will allow you to right justify the data.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top