#!/usr/bin/perl # Add note codes to the tmp.merge file using the list in the file.lst file. open (LST,"file.lst"); while ($line=) { chop $line; $filename = substr($line,0,8); $number = substr($line,9,2); $note{$filename} = $number; } close(LST); open(TAB,"tmp.merge"); open(OUT,">newpflx.tab"); while ($line=) { chop $line; $filename = substr($line,159,8); $code = ($note{$filename})? $note{$filename} : "-9"; printf OUT "$line $code\r\n"; } close(TAB); close(OUT);