develooper Front page | perl.beginners | Postings from October 2009

Re: tabular printing

Thread Previous | Thread Next
October 5, 2009 02:24
Re: tabular printing
Message ID:
$ perl
printf "%15s %15s\n", "hello", "world";
          hello           world

Alexandr A Alexeev

Andreas Moroder пишет:
> Hello,
> I want pro print to screen two strings. The problem ist that the 
> length of the strings are variable, so I get a unreadable output. Even 
> using \t does not help because the lenght can vary from 5 to 15 
> characters.
> Is there a simple way to expand the first columnt to a fixex size.
> Thanks
> Andreas

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About