#!/usr/bin/perl -w
use strict;

sub processgtdata
{
	my $cols=shift;
	my $data=shift;
	my @lines;
	while ($data =~ /<tr[^>]*>(.*?)<.tr[^>]*>/ig)
	{
		my @line=processgtline($1);

		$line[0] =~ s/(\d+)-(\d+)-(\d+)/$3-$2-$1/;
		push(@lines, \@line) unless (@line!=$cols);
	}
	return @lines;
}

sub processgtline
{
	my $line=shift;
	my @list;
	while ($line =~ /<td[^>]*>(.*?)<.td[^>]*>/ig)
	{
		push(@list, $1);
	}
	return @list;
}

1;
