in reply to Sneeky Snake

i wrote this ugly piece of code for joke, you should write a real parser using HTML::TableExtract as suggested by extremely
for some strange reason it seems to get the work done (sort of)
#!/usr/bin/perl -w open TEXT, 'country_7.html' || die $!; my $text; while(<TEXT>) { ## lot of ram... chomp; $text .= $_; } $text =~ s/<\/table.*//; my @lines = split /<tr>/im, $text; shift @lines; ## drop trailing html shift @lines; ## ...and <th>.. foreach my $line (@lines) { $line =~ s/<\/tr>//i; $line =~ s/<\/td>//gi; my @values = split /<td[\sa-zA-Z=]*>/im, $line; shift @values; print '|'; foreach my $value (@values) { $value =~ s/<\/a>//; $value =~ s/&nbsp;//; $value =~ s/<a .+>//; print $value , "|"; } print "\n"; }