I have a simple HTML file .. the contents off which i have included below : ###############
<table class="gridtable" summary="RegTable"> <tr><th>Address</th><th>Register</th><th>7</th><th>6</th><th>5</th><th +>4</th><th>3</th><th>2</th><th>1</th><th>0</th><th>Reset</th><th>Desc +ription</th></tr> <tr><td>0x00000001</td><td><a href="#RegisterMap:REG0000">REG0000</a>< +/td><td align=center colspan=6> TEMP </td><td align=center > STOP </t +d><td align=center > START </td><td>'h14</td><td>TEMPORARY REG.</td>< +/tr> </table> <table class="gridtable" summary="RegTable"> <tr><th>Address</th><th>Register</th><th>15</th><th>14</th><th>13</th> +<th>12</th><th>11</th><th>10</th><th>9</th><th>8</th><th>7</th><th>6< +/th><th>5</th><th>4</th><th>3</th><th>2</th><th>1</th><th>0</th><th>R +eset</th><th>Description</th></tr> <tr><td>0x00000100</td><td><a href="#FuseMap:FUSE0">FUSE0</a></td><td +align=center colspan=8> F_1 </td><td align=center colspan=8> F_0 </td +><td>'h0000</td><td>FUSE0.</td></tr> </table>
########### I basically has two tables I wrote the following perl script to extract the table based on a header match: ###########
use HTML::TableExtract; my $file = 'temp.html'; @headers = qw( Address Register 15 14 13 12 11 10 9 8 7 6 5); print " \n h:@headers:\n"; $te = new HTML::TableExtract( keep_html=>1,headers => \@headers); $te->parse_file($file); @tcount1 = $te->counts(0); print " tcount1 : @tcount1:\n";
######## Basically i could like to extract the second table, but for some reasons the extraction does not seem to work .. If however i remove the last entry in the header list i.e. if i have the header as just
@headers = qw( Address Register 15 14 13 12 11 10 9 8 7 6);
It works fine .. but with the header as :
@headers = qw( Address Register 15 14 13 12 11 10 9 8 7 6 5);
It does not work .. Not sure if i have done something wrong here .. but can someone help me out .. I could like to have the header as
@headers = qw( Address Register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 +);
for some reasons and not a truncated header .. Any suggestions could be great .. Perl version 5.14.2

In reply to Table Extract Header Match by perlmuser

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.