zoya has asked for the wisdom of the Perl Monks concerning the following question:
<TABLE border="0"><TR valign="top"><td ><TABLE id="RefSNP" cellpadd +ing="2" width="350" ><TH class="text10" bgcolor="#ccccff" align="cen +ter" colspan="2">RefSNP</TH><TR ><td class="text10" bgcolor="#f1f1f1 +" align="right"><strong>Organism:</strong></td><td class="text10" bg +color="#f1f1f1">human (<a href="http://www.ncbi.nlm.nih.gov/Taxonomy/ +Browser/wwwtax.cgi?mode=Info&id=9606"><em>Homo sapiens</em></a>)</td> +</TR><TR
This is my code kindly plz anybody helpuse HTML::TableExtract; my $te = HTML::TableExtract->new( keep_html=>1, headers =>[qw(RefSNP)]); my $file = "Reference SNP(refSNP) Cluster Report rs111.htm"; my $document = do { local $/ = undef; open my $fh, "<", $file or die "could not open $file: $!"; <$fh>; }; $te->parse( $document); for my $ts($te->tables) { print "Table(",join(',',$ts->coords),":\n"; for my $row ($ts->rows) { for my $cell (@$row) { next unless $cell; $cell =~ s/<\/B> //i; print $cell."\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl, HTML::TableExtract
by NetWallah (Canon) on Apr 28, 2013 at 14:55 UTC | |
|
Re: Perl, HTML::TableExtract
by hdb (Monsignor) on Apr 28, 2013 at 14:52 UTC | |
|
Re: Perl, HTML::TableExtract
by Khen1950fx (Canon) on Apr 28, 2013 at 15:49 UTC |