title: Python Read File, Look up a String and Remove Characters
body: <p>I have a set of numbers (NDC - drug numbers) that have a <code>-</code> in them. I am trying to read the file, remove the <code>-</code> and write the numbers to a new file. Any help with this would be appreciated. Using Py 2.7</p>
  
  <pre><code>1. 68817-0134-50
  2. 68817-0134-50
  3. 68817-0134-50
  </code></pre>
  
  <p>The issue is that the hyphen is not always in the same position. </p>
  
  <pre><code>1. 8290-033010
  </code></pre>
  
  <p>It changes and can be in any position</p>
  
  <pre><code>with open('c:\NDCHypen.txt', 'r') as infile,
       open('c:\NDCOnly.txt', 'w') as outfile:
      replace("-", "")
  </code></pre>