title: Sed with python and many parameters
body: <p>I have a big file with some lines like:</p>
  
  <h2>Users.txt</h2>
  
  <ul>
  <li>User1:jhonny</li>
  <li>User2:Mary</li>
  <li>User3:Jane</li>
  </ul>
  
  <p>And another file with:</p>
  
  <h2>Data.txt</h2>
  
  <ul>
  <li>User1:Brown</li>
  <li>User3:Yellow</li>
  <li>User2:Green</li>
  </ul>
  
  <p>I want to make just one file, replacing the first field of Data.txt with the second field in Users.txt.
  On the final, it may look like this:</p>
  
  <h2>Final.txt</h2>
  
  <ul>
  <li>Jhonny:Brown</li>
  <li>Jane:Yellow</li>
  <li>Mary:Green</li>
  </ul>
  
  <p>I have made the following code in python.</p>
  
  <pre><code>with open("File", "r") as sources:
      lines = sources.readlines()
  with open("File", "w") as sources:
      for line in lines:
          sources.write(re.sub(r'TextToReplace', 'ParameterToReplace', line))
  </code></pre>
  
  <p>I need to replace TextToReplace with the first field on the file Users.txt and the ParameterToReplace is the second field on Users.txt. Many times, with 30M+ parameters.</p>
  
  <p>It's like a command <code>sed 's/TextToReplace/ParameterToReplace/" File</code></p>
  
  <ul>
  <li>TextToReplace = The old text to be replaced.</li>
  <li>ParameterToReplace = The new text.</li>
  </ul>