It pretty much loops like this throughout, what i'm trying to do is convert this to a csv or something and ingest it into a DB. If i can directly write to the DB when looping through that'll be ever better. Let me know if you can help me. With any solution. P.S this is my script so far.<BR><B> 00:00 - 00:15 </B> <TABLE BORDER> <TR> <TD> Channel </TD> <TD> Call Letters </TD> <TD> Count </TD> <TD> Percent </TD> <TD> Title </TD> </TR> <TR></TR> <TR> <TD align=right> 1 </TD> <TD > ch1 </TD> <TD align=right> 22 </TD> <TD > 6.52% </TD> <TD > Program 1 </TD> </TR> <TR> <TD align=right> 3 </TD> <TD > Ch1 </TD> <TD align=right> 5 </TD> <TD > 1.48% </TD> <TD > Program2 </TD> </TR> <TR> <TD align=right> 4 </TD> <TD > Ch 3 </TD> <TD align=right> 1 </TD> <TD > 0.29% </TD> <TD > Program3 </TD> </TR> <TR> <TD align=right> 5 </TD> <TD > CH53 </TD> <TD align=right> 5 </TD> <TD > 1.48% </TD> <TD > Program4 </TD> </TR> <TR> <TD align=right> 6 </TD> <TD > C </TD> <TD align=right> 3 </TD> <TD > 0.89% </TD> <TD > Program5 </TD> </TR> </TABLE>
It only processes the FIRST table tho... not the rest of the document.use warnings; use strict; use HTML::TableExtract; use LWP::Simple; my $file ="/path/to/file/file.htm"; my $T = HTML::TableExtract->new(); my $table = $T->parse_file($file) ->first_table_found; my @rows = $table->rows; foreach my $row ($T->rows) { print join(',', @$row), "\n"; }
In reply to HTML Table to MYSQL DB by Fiddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |