From: "Michael W. Ryder" <_mwryder@...> Date: 2008-12-06T10:03:58+09:00 Subject: Re: formatting print output joemacbusiness@gmail.com wrote: > Hi All, > > How do I format the output from print or puts > so that columns are aligned: > > So this: > beagle-status 255 > bibtex 154312 > bioradtopgm 7844 > bison 242032 > blackjack 140792 > > > becomes this: > > beagle-status 255 > bibtex 154312 > bioradtopgm 7844 > bison 242032 > blackjack 140792 > You mean something like: irb(main):001:0> puts "beagle-status".ljust(20) + "255".rjust(10) beagle-status 255 => nil irb(main):002:0> puts "bibtex".ljust(20) + "154312".rjust(10) bibtex 154312 => nil > You probably know what I mean. > I could not find this in my Ruby book (Cooper) > and a lot of the Ruby Websites cannot be accessed. > > Thank you, --JM > > > > >