Depends on how complicated you HTML file is -

Check out HTML::TokeParser for parsing HTML file in a nice way.

However if your HTML file is as simple as <HTML><BODY><Tag>Stuff1=val1,Stuff2=Val2</tag></BODY> </HTML> then I would just do a simple regex and we can help you if we see the HTML page.

regarding reading 3000 files that is very simple

foreach my $file (@ARGV) { my $fh; open $fh, "<", $file or die "Can't open $file ($!)"; push @filehandles, $fh; }

Once you have your handles you can loop through them. Actually you can do this whole thing in a while loop instead of storing the handbles. something like  while ($i++ < 3000) { open (blah,blah); do_stuff with blah; }

there is also glob if your filenames are not counter based i.e. file1 file2 etc.

For DB part - you can use DBI. once you have the values you can instert them into a table easily. You can also create a CSV file and then just load them into the DB (most DBs support that)

cheers

SK


In reply to Re: Particular HTML contents to CSV or DB by sk
in thread Particular HTML contents to CSV or DB by nicpon

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.