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

Re: tabular printing

Thread Previous | Thread Next
From:
=?UTF-8?B?0JDQu9C10LrRgdC10LXQsiDQkNC70LXQutGB0LDQvdC00YA=?=
Date:
October 5, 2009 02:24
Subject:
Re: tabular printing
Message ID:
4AC9BB81.70903@rumonitor.ru
$ perl
printf "%15s %15s\n", "hello", "world";
^D
          hello           world

--
Alexandr A Alexeev
http://web20.su/

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About