So basically I have a original list of 1500 names with a 4 digit number associated with each name. I have another file which contains 200 of these 1500 names with a new 4 digit
Try the following:
while read old new ; do sed -i "s/$old \([^ ]*\)/$new \1/" original.txt done < updated_file.txt
Warning: with the -i option it will automatically update your original.txt file. Don't forget to make a backup copy first.
-i
original.txt