Offending code
Hello,
I parse apart some reports and the data is 90deg out from how it needs to go into the DB. So I rotate it and go to print it out how I would insert it and... it don't work.
print Dumper %matrix;
print Dumper @dates;
for my $ii (0..$#dates - 1)
{
print "@dates[$ii], $matrix{youn}[$ii], $matrix{anch}[$ii], $matrix
+{baxt}[$ii], $matrix{chey}[$ii], $matrix{aggr}[$ii]\n";
}
I get the following:
$VAR1 = {
'ANCHSN15K01' => [
'151659',
'181307',
'151184',
'129956',
'134802',
'145494',
'150087',
'1044489'
],
'YOUNSN15K03' => [
'357296',
'366914',
'381503',
'372149',
'339996',
'343442',
'336182',
'2497482'
],
'CHEYSN15KA01' => [
'254768',
'264576',
'279182',
'273364',
'244371',
'246284',
'245891',
'1808436'
],
'BAXTSN15KA01' => [
'223618',
'229512',
'236444',
'241737',
'219792',
'219184',
'219379',
'1589666'
]
};
$VAR1 = '14 Mar 07';
$VAR2 = '15 Mar 07';
$VAR3 = '16 Mar 07';
$VAR4 = '17 Mar 07';
$VAR5 = '18 Mar 07';
$VAR6 = '19 Mar 07';
$VAR7 = '20 Mar 07';
$VAR8 = 'AGGR.';
14 Mar 07, , , , ,
15 Mar 07, , , , ,
16 Mar 07, , , , ,
17 Mar 07, , , , ,
18 Mar 07, , , , ,
19 Mar 07, , , , ,
20 Mar 07, , , , ,
Here is how I'm creating the hash
tie my @lines, 'Tie::File', $data;
my %matrix = ();
my @dates;
for my $ii (0 .. $#lines -1)
{
$lines[$ii] =~ s/\"//g;
my @tmp = split /,/, $lines[$ii];
if ($ii == 0)
{
@dates = @tmp[2..$#tmp];
next;
}
$matrix{$tmp[0]} = [@tmp[2..$#tmp]];
}
Thanks,
JimB
</code>
|