in reply to Re^2: Dynamically build a table
in thread Dynamically build a table
Hi, is this what you are looking for:
This is the output:use strict; use warnings; use Data::Dumper; my $file = "1.00 InDev 01-Jun-2013 1.00 InTest 15-Jul-2013 1.00 InUAT 31-Jul-2013 1.00 InProd 15-Sep-2013 1.01 InDev 01-Jul-2013 2.00 InDev 01-Aug-2013 3.00 InDev 01-Sep-2013"; my @file_content = split( /\n/, $file ); my @full_data; push @full_data, [split] for @file_content; for my $line_ref (@full_data) { print "$_\t" for @$line_ref; print "\n"; }
$ perl table.pl 1.00 InDev 01-Jun-2013 1.00 InTest 15-Jul-2013 1.00 InUAT 31-Jul-2013 1.00 InProd 15-Sep-2013 1.01 InDev 01-Jul-2013 2.00 InDev 01-Aug-2013 3.00 InDev 01-Sep-2013
Update Mar 11, 19:45 UTC: Looking again at the OP and at another answer you made which I had not seen, I think I now understand what you are trying to do (and the above is not what you need). You're basically wanting to do a form of transposition of the data, where, in part, what you have in row form should not appear in columns, and vice-versa, although it is not a simple matrix transposition. I don't have time right now (I'm gonna have dinner with my family right now), but I think I can come back to it in a couple of hours unless someone else does it before me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Dynamically build a table
by Laurent_R (Canon) on Mar 11, 2014 at 22:06 UTC |