
# Parse html tables.
# Ward Cunningham 3/2002

use strict;

open(F, 'content-syncronization.htm');
$_ = join ('', <F>);

for (/  <table.*?>  .*?  <\/table>  /sgix) {
	for (/  <tr.*?>     .*?  <\/tr>     /sgix) {
		for (/  <td.*?>     .*?  <\/td>     /sgix) {
			s/  <.*?>  //sgx;
			&unescape();
			&unpad();
			print "[$_]\t";
		}
		print "\n";
	}
	print "\n";
}

sub unescape {
	s/&nbsp;/ /gi;
	s/&lt;/</gi;
	s/&gt;/>/gi;
	s/&amp;/&/gi;
}

sub unpad {
	s/\n//g;
	s/^ *//;
	s/ *$//;
}