in reply to Re^2: How to add hyperlink for every table data using perl?
in thread How to add hyperlink for every table data using perl?

How can i hyperlink only the first column of the table using perl.The above code will hyperlink all contents of table data>
  • Comment on Re^3: How to add hyperlink for every table data using perl?

Replies are listed 'Best First'.
Re^4: How to add hyperlink for every table data using perl?
by huck (Prior) on Mar 09, 2017 at 06:57 UTC

    while (my $line=<$fh>) { chomp $line; for($line) { s/\&//g; s/[\\\_\@\_]//g; s/COMMENT//g; } my @data = split /:/, $line; my $class = $data[0] ? 'normal' : 'bold'; print $fh_out qq[<tr class="$class">]; my $ct=0; for my $word(@data){ $ct++; print $fh_out '<td>'; if ($ct==1){ print $fh_out '<a href="' .$href_to_what{$word} .'">'; } print $fh_out $word; if ($ct==1){ print $fh_out '</a>'; } print $fh_out '</td>'; } print $fh_out "</tr>\n"; }
    Untested, YMMV

      I have few more doubts.i want to stop this process at some directory levels.Can i able to do? for example my tree struture:
      DCMS_DEMO |-- DCMS_DEMO.config |-- DCMS_DEMO.html |-- de_top | |-- Block_DV | | |-- Block_DV.config | | |-- Block_DV.html | | |-- rev1 | | | |-- rev1.config | | | `-- rev1.html | | `-- rev2 | | |-- rev2.config | | `-- rev2.html
      The above script conversion should be done until the following levels.Now my script imports the hyprlinks for all directory levels.How can i do it.Is it possible?
      |-- DCMS_DEMO.config |-- DCMS_DEMO.html |-- de_top | |-- Block_DV | | |-- Block_DV.config | | |-- Block_DV.html
      And also the a href links from directory to directory level. if i click any of contents from DCMS_DEMO.html it should link with Block_DV.html.Likewise for Block_DV.html.But the link attachements should stop at Block_DV directories.