#! /usr/bin/perl

use strict;

my $names = $ARGV[0];
my $out = $ARGV[1];

my $text = `cat $out`;

open(O,$names);
my $line;
while($line = <O>)
{
    chomp($line);
    my $source = `echo "$line" | gawk '{print \$1}'`;
    my $dest = `echo "$line" | gawk '{print \$2}'`;
    chomp($source);
    chomp($dest);
    my $len1 = length($source);
    my $len2 = length($dest);
    
    my $n = 0;
    for(;$n < ($len1-$len2);$n++)
    {
	$dest = $dest." ";

    }
#print $source."\t".$dest."\n";
    if( $dest ne "")
    {
	$source =~ s/\|/\\\|/g;
	$source =~ s/\_/\\\_/g;
	$source =~ s/\-/\\\-/g;
	$text =~ s/$source/$dest/g;
    }
    
}

close(O);

print $text;
