Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

format output

i have a cgi script with the print statement:

print "$a $b $c $d $e <br>";
how do i format this so that they can seem to appear in same column

i want 26 space for $a, 26 for $b, 5 for $c, 5 for $d, 5 for $e.


example) right now the output is like:
rahulshah temp 3 4 5
shailendramaheswar jamnshfkf 4 5 6

what i want is:


rahulshah                  temp                    3     4     5
shailendramaheswar   jamnshfkf             4     5     6
0
shahrahulb
Asked:
shahrahulb
1 Solution
 
ozoCommented:
($_ = sprintf"%26s%26s%5s%5s%5s<br>",$a,$b,$c,$d,$e) =~ s/ /&nbsp;/g;
print;
#or
printf"<pre>%26s%26s%5s%5s%5s\n</pre>",$a,$b,$c,$d,$e;
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now