
$files=`cat filmlist.txt`;
$_=$files;
#print "hi\n\n";

@filesa= split /\n/;

foreach(@filesa) {
#	print "$_\n";
#	print join(':', split(/\./, $_));
	@prefix = split(/\./,$_);
	$filename = $prefix[0];
#	print "$filename : ";
	$firstchar = substr($prefix[0], 0, 1);
#	print "$firstchar\n\n";
	$foldernumber = $firstchar + 1;
	print "<tr>\n";
#mpegs
	print "<td><a href=\"http://projects.csail.mit.edu/films/digitalFilms/";
	print "$foldernumber";
	print "mpeg/$filename";
	print ".mpg\">$filename";
	print ".mpg</a></td>\n";
# mp4s
	print "<td><a href=\"http://projects.csail.mit.edu/films/digitalFilms/";
	print "$foldernumber";
	print "mp4/$filename";
	print ".mp4\">$filename";
	print ".mp4</a></td>\n";

	print "</tr>\n";

	print "\n\n";
	}

