#!/usr/bin/perl

open (C, "codes.txt") or die;
open (T, "tiplocs.txt") or die;

while(<T>) {
  @l=split(/,/);
  $crs=$l[1];
  if ($l[3] ne "&nbsp;" && $l[3] ne " ") {
    $tiploc{$crs}=$l[3];
  }
}

while(<C>) {
  chomp;
  print;
  my $shortnum=52 - length($_);
  @l=split;
  $crs=$l[0];
  printf "%".$shortnum."s"," ";
  if ($tiploc{$crs}) {
    print $tiploc{$crs};
  } else {
    print "-"
  }
  print "\n";
}
