title: Normalize Phone Numbers Using Python
body: <p>I am extremely new to python. I often get text files that have phone numbers is various formats. I am trying to create a python script that takes this text file and normalizes them into a format I can use. </p>
  
  <p>I am trying to remove all symbols and spaces and just leave the numbers. As  well as add <code>+1</code> to the beginning and a comma (<code>,</code>) at the end.</p>
  
  <pre><code>import re
  
  with open("test_numbers.txt") as file:
      dirty = file.read()
      clean = re.sub(r'[^0-9]', '', dirty)
  
  print clean
  </code></pre>
  
  <p>I'm trying to use regex but it puts everything on a single line. Maybe I am going about this all wrong. I have not worked out a way to add the <code>+1</code> to the beginning of the number or add a comma at the end. Would appreciate any advice.</p>