cutter has asked for the wisdom of the Perl Monks concerning the following question:
Output should look like thisUpdate Time: 2005.04.27 15:44:12 Targets: 4 Complete: 4(100%) Waiting: 0
I had created a hash by splitting on the : and pushing the keys and values into seperate arrays and then printing the arrays back. But the time value HH:MM:SS causes problems and I don't like assuming that the headers will match the values by printing the array of keys then the array of values. SampleUpdate Time,Targets,Complete,Waiting 2005.04.27 15:44:12,4,4(100%),0
while(my($key, $value) = each(%list)){ push(@headers, $key); push(@values, $value); } print "@headers\n"; print "@values\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating a CSV file
by dragonchild (Archbishop) on Apr 28, 2005 at 19:00 UTC | |
|
Re: Creating a CSV file
by JediWizard (Deacon) on Apr 28, 2005 at 18:59 UTC | |
|
Re: Creating a CSV file
by Transient (Hermit) on Apr 28, 2005 at 18:51 UTC | |
|
Re: Creating a CSV file
by trammell (Priest) on Apr 28, 2005 at 21:00 UTC | |
|
Re: Creating a CSV file
by LanceDeeply (Chaplain) on Apr 28, 2005 at 20:08 UTC | |
|
Re: Creating a CSV file
by NateTut (Deacon) on Apr 28, 2005 at 20:41 UTC |