]> git.donarmstrong.com Git - imprinted_genes.git/blobdiff - parse_geneimprint.pl
fix the look_down to only look at th and td elements
[imprinted_genes.git] / parse_geneimprint.pl
index 4f36a9a3a32dadab7336dc452f4db221e17bd8a5..7de04b00250edfbd3c89966a98271c6084bcdc4b 100755 (executable)
@@ -80,7 +80,7 @@ my $t = HTML::Tree->new_from_file($ARGV[0]) or
 # the table we want is currently the first table
 my $table = $t->look_down(_tag=>'table');
 for my $row ($table->look_down(_tag=>'tr')) {
-    print join("\t",map{my $a = $_->as_text(); $a =~ s/\xA0/ /g; $a;} $row->descendents())."\n";
+    print join("\t",map{my $a = $_->as_text(); $a =~ s/[\xA0\t]/ /g; $a;} $row->look_down(_tag => qr/^(?:th|td)$/))."\n";
 }