#!/usr/athena/bin/perl
open (FI, "/usr/tmp/old") || die "No old file";
open (FT, "/usr/tmp/new") || "No new table";
open (FILE, "/usr/tmp/file") || "No file!";
open (NF, ">/usr/tmp/file.new") || "Couldn't create new file";

$i = 0;
while(<FI>) {
	@codes =split;
	foreach $thing (@codes) {
		$translateo[$i] = $thing;
		$i++;
		}
	}
$i=0;
while(<FT>) {
	@codes =split;
	foreach $thing (@codes) {
		$translaten[$i] = $thing;
		$i++;
		}
	}
print("Done creating tables\n");
print("$#translateo	$#translaten\n");
while(<FILE>) {
	foreach $rep (0 .. $#translateo) {
		s/$translateo[$rep]/$translaten[$rep]/;
		}
	print(STDERR ".");
	print(NF $_);
}
close(NF);
