perl_geek has asked for the wisdom of the Perl Monks concerning the following question:
I am new to perl. I have to convert the format of data as follows:
Existing data format:
(Please note that actual data contains more number of rows and colmns.. and not pre-defined)
The data format I need is:----------------------- 1 2 3 a b c x y z -----------------------
I am going to use the new formatted data for an input to create graphs. I have all the necessary modules installed but this logic (I know it is not very complicated, but I am not getting it). Please advice how to take it forward. My final objective is to get the data in variable in somthing similar to following:----------------------- 1 a x 2 b y 3 c z -----------------------
Please help.my @data = (['1','a','x' ], ['2','b','y' ], ['3','c','z' ]);
Folks, The fact is that I am totally lost now :-) My objective was/is: To read a flat file which has SAR (system activity reporter) data and then to generate the graph using that data. I have module for graph but the problem here is the data needs to be transversed (row-> columns). My data looks like:=============================
And for the graph creation, I need this data in following format:17:12:41 0 0 0 100 17:12:42 0 1 0 99 17:12:43 0 0 0 100 : :
Finally, to get an array like below:17:12:41 17:12:42 17:12:43 : : ... ... ... 0 0 0 : : ... ... ... 0 1 0 : : ... ... ... 0 0 0 : : ... ... ... 100 99 100 : : ... ... ...
my @data = ( ['17:12:41','17:12:42','17:12:43'.........], ['0','1','0'.........], ['0','0','0'.........], ['100','99','100'.....]);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to swap rows with columns?
by NetWallah (Canon) on Oct 09, 2007 at 20:18 UTC | |
| |
Re: How to swap rows with columns?
by ikegami (Patriarch) on Oct 09, 2007 at 20:17 UTC | |
by jdporter (Paladin) on Oct 09, 2007 at 20:47 UTC | |
by ikegami (Patriarch) on Oct 09, 2007 at 21:05 UTC | |
by jdporter (Paladin) on Oct 10, 2007 at 04:39 UTC | |
by NetWallah (Canon) on Oct 10, 2007 at 03:44 UTC | |
by BrowserUk (Patriarch) on Oct 10, 2007 at 05:24 UTC | |
by ikegami (Patriarch) on Oct 10, 2007 at 05:48 UTC | |
by ikegami (Patriarch) on Oct 10, 2007 at 05:42 UTC | |
by jdporter (Paladin) on Oct 10, 2007 at 05:03 UTC | |
Re: How to swap rows with columns?
by ysth (Canon) on Oct 10, 2007 at 02:27 UTC | |
Re: How to swap rows with columns?
by blah (Novice) on Oct 09, 2007 at 21:55 UTC | |
Re: How to swap rows with columns?
by dragonchild (Archbishop) on Nov 01, 2007 at 20:12 UTC | |
Re: How to swap rows with columns?
by mwah (Hermit) on Oct 09, 2007 at 21:16 UTC | |
by FunkyMonk (Chancellor) on Oct 09, 2007 at 22:10 UTC | |
Re: How to swap rows with columns?
by johngg (Canon) on Oct 10, 2007 at 14:22 UTC | |
by BrowserUk (Patriarch) on Oct 10, 2007 at 16:00 UTC | |
by johngg (Canon) on Oct 10, 2007 at 20:43 UTC | |
by BrowserUk (Patriarch) on Oct 10, 2007 at 22:42 UTC | |
Re: How to swap rows with columns?
by snopal (Pilgrim) on Oct 09, 2007 at 21:09 UTC | |
by snopal (Pilgrim) on Oct 09, 2007 at 21:38 UTC | |
by johngg (Canon) on Oct 09, 2007 at 22:11 UTC | |
by snopal (Pilgrim) on Oct 10, 2007 at 02:14 UTC | |
|
Back to
Seekers of Perl Wisdom