I have a html file. I would like to extract certain data/lines/strings and create a hash array using perl. I have written perl scripts using regex earlier but how to use HTML perl modules?
These are the lines in the file:
<td><b>SCORE</b></td><td>WEIGHT</td><td>GOAL</td><td class="alfsrt">N
+AME</td></tr><tr>
<td class="s5 rt"> 59.37</td>
<td class="wht">1 </td>
<td class="wht">100 </td>
<td><a name="tag_ddr3ctrl_top.T0::ddr3ctrl_coverage::inputs"></a>
<a href="grp0.html" >ddr3ctrl_top.T0::ddr3ctrl_coverage::inputs</a></t
+d>
</tr><tr>
<td class="s7 rt"> 78.32</td>
<td class="wht">1 </td>
<td class="wht">100 </td>
<td><a name="tag_ddr3ctrl_top.T0::ddr3ctrl_coverage::outputs"></a>
<a href="grp1.html" >ddr3ctrl_top.T0::ddr3ctrl_coverage::outputs</a></
+td>
I want to extract the following by parsing the file:
1) s5, grp0.html, inputs
2) s7, grp1.html, outputs
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.