in reply to Report generation through formats
I abandoned the use of formats many years ago, and at first glance i think it is not possible to achieve what you want.
But as side note you have many uncautious statements:
UPDATE: i'd go with something like:
use strict; use warnings; my $cur_pers = ''; my $sep = ('-'x70)."\n"; # print header print '=' x 70, "\n", (join "\t",('Name','Format of match', 'matches played','runs','scored','page 1')), "\n", '=' x 70, "\n"; while (<DATA>){ chomp; my @elements = split /!/,$_; # check if person change if ( $cur_pers ne $elements[0]){ print $sep; $cur_pers = $elements[0]; } print +(join "\t",@elements),"\n" } __DATA__ sachin tendulkar!ODI!434!12000 sachin tendulkar!Test!246!10900 sachin tendulkar!T20!189!5000 sourav ganguly!ODI!334!8000 sourav ganguly!Test!235!5000 sourav ganguly!T20!124!1800 rahul dravid!ODI!387!9000 rahul dravid!Test!212!5980 rahul dravid!T20!43!1345
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Report generation through formats
by ankit.tayal560 (Beadle) on Oct 14, 2016 at 07:19 UTC | |
by duelafn (Parson) on Oct 14, 2016 at 10:18 UTC | |
by marto (Cardinal) on Oct 14, 2016 at 07:24 UTC | |
by Anonymous Monk on Oct 14, 2016 at 08:08 UTC |