Is there a simple way to do a find and replace of values in a file, using another file as input for the values that need to be re-labelled? E.g. I have a tab-delimited file1 with two columns:
a|1|b|C|:1-10(-) A1
a|2|b|E|:2-11(+) A2
a_b|3|b|C|:300-302(-) A3
a|5|b|C|:4-60(+) A1
a|7|b|D|:71-72(-) A11
where column 1 (everything before the tab) contains the original name, and column 2 contains the new name. I would like to feed this into a file2, to replace all occurrences of the values. I know that using
sed -i -e 's/a|1|b|C|:1-10(-)/A1/g' file2.txt
will do this one line at a time, but is there a way to just feed in file1 such that all the values in file2 will get re-labelled at once?