Hi All, I am trying to write a perl script which shows the report like a table with below details: Branch Name: FileName changed| Author | revision number of the file 1)we use SVN as our version control tool, so our intention is to use svn commands and generate a basic report and then use perl script to neatly organize it. I am unable to allign the output as a table. Expected result: Branch Name: release_1 FileName Changed| Author | Revision Number of file changed| hello1.c | saketh1 | r120 hello2.c | saketh2 | r12 hello3.c | saketh3 | r100 Current/ERROR OUTPUT: Branch Name: release_1 FileName Changed| Author | Revision Number of file changed| hello1.c | saketh1 | r120 hello2.c | saketh2 | r12 hello1.c | saketh3 | r100

#!/usr/local/bin/perl require "List/MoreUtils.pm"; use strict; use List::MoreUtils qw(:all); my @FilePath=`svn log RepoUrl -v -q | awk '/paths/ { getline; print $1 + }'| awk -F' ' '{print \$2}'|awk -F'/' '{print \$NF}'`; my @Author=`svn log RepoUrl -q | awk -F'|' '{print \$2}'| awk 'NF' `; my @Revision=`svn log RepoUrl -q | awk -F'|' '{print \$1}'| sed 's/'-' +//g'| awk 'NF' `; my $branch=`svn info RepoUrl | grep ^URL | awk -F'/' '{print \$NF}'`; printf " Branch : $branch + \n" +; printf "|============================================================ +===================================================================== +=======|\n"; printf "| %-35s | %-35s | %-35s \n"," FILENAME ", " AUTHOR "," + VERSION "; printf "|============================================================ +===================================================================== +=======|\n"; my $result = each_array(@FilePath, @Author, @Revision); while ( my ($a, $b, $c) = $result->() ) { printf "$a"."\t"."$b"."\t"."$c"; } printf "|============================================================ +===================================================================== +=======|\n"; Expected result: Branch Name: release_1 FileName Changed| Author | Revision Number of file change +d| hello1.c | saketh1 | r120 hello2.c | saketh2 | r12 hello3.c | saketh3 | r100 Current/ERROR OUTPUT: Branch Name: release_1 FileName Changed| Author | Revision Number of file change +d| hello1.c | saketh1 | r120 hello2.c | saketh2 | r12 hello1.c | saketh3 | r100

In reply to print a tabular report using perl by saketh_hunk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.