Dear Experts,
Please find below the script in perl and can any body convert this script exactly in to oracle 9i fiunction which will return the required result same as perl.
#!/usr/bin/perl
$nof=@ARGV;
@var2 = ();
for($n=0; $n<$nof; $n++)
{
$filename = @ARGV[$n];
open (input, "<$filename");
while(<input>)
{
chomp;
@var3 = split(',',$_);
$cnt_var3 = @var3;
if(@var3[2] eq '501')
{
if($cnt_var3 eq '214')
{
for($i=0,$j=27; $i<15; $i++)
{
@var2[$i]+=@var3[$j];
$j = $j + 13;
}
}
else
{
for($i=0,$j=27; $i<15; )
{
@var2[$i]+=@var3[$j];
$k = $j + 5;
if(@var3[$k] eq '|')
{
$j = $j + 11;
}
else
{
$j = $j + 13;
$i++;
}
}
}
}
}
close (input);
}
$sum = 0;
for($i=0; $i<15; $i++)
{
print "@var2[$i],";
$sum+=@var2[$i];
}
print "$sum\n"
Thanks