########### I basically has two tables I wrote the following perl script to extract the table based on a header match: ###########<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>
######## 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 justuse 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";
It works fine .. but with the header as :@headers = qw( Address Register 15 14 13 12 11 10 9 8 7 6);
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);
for some reasons and not a truncated header .. Any suggestions could be great .. Perl version 5.14.2@headers = qw( Address Register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 +);
In reply to Table Extract Header Match by perlmuser
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |