Hi,
i am new to perl/programming, i have an excel file which contains values in the form of menu tree the main menu items are in the col1, and submenu on co2 ..., the submenus could be the mainmenu for another set of submenues and so on.
I need to get each of the main menu and its related sub menus under one column, if no submenus are available then a value in column 10 in that perticular row need to be under that perticular menu item. - hope I have explained correctly- just a tree structure
<t>could you please help I am not able to get the logic working here is one of the code with I tried
for $row (5..100)<\br>
{<\br>
<t><\t>
inner: for $col(1..10){<\br>
$testval= $Sheet->Cells($row,$col)->{'Value'};<\br>
$testval2 =$Sheet->Cells($row,$col+1)->{'Value'};<\br>
while ($testval||$testval2){<code><\br>
if ($col == 1) {<\br>
<code> $array[++$#array]="G $col : |: $testval";
<\br>
}else {<\br>
if ($testval2){<\br>
$arrray[++$#array]=" G $col : |: $testval" ;<\br>
}else{<\br>
$arrray[++$#array]=" P $col : |: $testval" ;<\br>
}<\br>
}<\br>
next inner;<\br>
}<\br>
}<\br>
}<\br>
Printsheet();<\br>
sub Printsheet(){<\br>
for my $x (0 .. $#array) {<\br>
print "$array[$x]\n";<\br>
}<\br>
</code>}<code>
please any input will be much appreciated