title: Find and replace multiple strings in file then output to new filename python
body: <p>I am looking to create a python script that will read one source file then produce another file with a string for the name. </p>
  
  <p>for example </p>
  
  <p>macaddress.cnf.xml contains the source file </p>
  
  <p>I need to change '6000' to '6001' in multiple places of macaddress.cnf.xml, then I want to output to newmacaddress.cnf.xl.</p>
  
  <p>This is what I have</p>
  
  <pre><code>#! /usr/bin/python
  #read and write to file
  f = open(file)
  for line in f:
      if line.contains('66001'):
          newline = line.replace('66001', '60001')
  </code></pre>
  
  <p>To add I would like to be able to do this with a csv or whatever and have the script run through and do </p>
  
  <p>60002 >> macaddressfromcsv.cnf.xml
  60003 >> macaddressfromcsv.cnf.xml
  60004 etc.</p>
  
  <p>Sorry I am very new to this any help would be great.</p>