title: Formatting a text file, how to update the file after I finished parsing it?
body: <p>How would I open a file, perform some regex on the file, and then save the file?</p>
  
  <p>I know I can open a file, read line by line, but how would I update the actual contents of a file and then save the file?</p>