title: find and replace multiple strings from text file in sed
body: <p>Below is a toy text file with sample and trait information, and a measurement.   </p>
  
  <pre><code>Sample3_trait1  8.5
  Sample6_trait2 2.2
  Sample7_trait1 9.2
  Sample3_trait2 1.3
  Sample6_trait1 10.0
  Sample7_trait2 2.1
  </code></pre>
  
  <p>I would like to replace the sample column with something more informative, like the actual name of the sample (say a persons name).  This would be relatively easy in <code>sed</code> if there were only 3 Samples, e.g. </p>
  
  <pre><code>sed  's/Sample3/john.D/g' file.txt
  </code></pre>
  
  <p>I could do this for each "sample". But i have 100s or thousands of sample names. </p>
  
  <p>What id like to do is give <code>sed</code> a text file with two columns, the original and the replacement: </p>
  
  <pre><code>Sample3 john.D
  Sample6 mary.D
  Sample7 kelly.O
  ....
  Sample1001 amy.P
  </code></pre>
  
  <p>And have them replaced wherever they appear throughout the file (globally), i.e., whereever Sample3 is found, replace with john.D.</p>
  
  <p>Is this something that I could do with a loop in Bash? I could loop over a single column (row by row), but Im not sure what to do with matched columns. </p>
  
  <p>Any help would be much appreciated.</p>