I have another task here at the office that looks like a good chance to expand my limited Perl skills some more. Basically, thru a sad series of events we lost one of our servers and all the files on it. These files included a listing of jobs by number, pay rate, number of positions, ect.
Well, with the original files is now gone, all we have left is the HTML website descriptions of these jobs from two years ago. I am planning on using something like the LWP module to import the html file then parse it using the html code in the actual file to identify the stings I want to extract. Since the html file was generated from the original database file, it has a very regular form. A block of it might look something like this:
Accounting Assistant, Level 2
<span name=”em”>Plow, Elliot</span>
<span name=“em”>Wang, Susan</span>
Job descriptions here.
This block quoted text contains a job description and it what I am rea
+lly looking to recover.
<blockquote><a href="#top">Go to the top of this page</a>.</blockquote
<blockquote><a href=”companyHR.html”>Check for open positions now!</a>
What I am worried about is that I have a list of jobserial numbers here from the accounting department and my boss basically wants me to recover all of the Job description text, without grabbing the other two bits of text inside of the second and third sets of blockquote tags.
My question to you all is can this be done with a fancy regex or is there a module on Cpan that I missed that does this already? If so could you kindly point me in the right direction?
Thank you very much,
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||