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

In reply to Excel -App - extract values and reformat by jarard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.