Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/opt/perl-5.6.1/bin/perl -w
  2. BEGIN { push (@INC, "/home/chanyan1/rta/");
  3. }
  4. use lib qw( ..);
  5. use HTML::TableExtract;
  6. use LWP::Simple;
  7. use Data::Dumper;
  8. use strict;
  9.  
  10. my $row;
  11.  
  12. my $te = new HTML::TableExtract;
  13. my $content = "config.xml";
  14.  
  15. my $dir = ".";
  16. my $xfile = "${dir}/$content";
  17. print "xfile=$xfile\n";
  18.  
  19. $te->parse($content);
  20. print "parsed\n";
  21.  
  22. my @ts = $te->tables;
  23. print "tabled\n";
  24.  
  25. for my $ts(@ts){
  26. print "table";
  27. print "Table (", join(',', $ts->coords), "):\n";
  28. foreach $row ($ts->rows)
  29. {
  30. print join(',', @$row), "\n";
  31. print Dumper $row;
  32. # print Dumper $row if (scalar(@$row) == 2);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement