remove and insert lines in a text file,outfile.write(line)