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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |