file = raw_input("Enter File path and name: ") bytes = open(file, "rb").read() i=0 c="" while i < len(bytes): if bytes[i] == "\x0a": c += "\x0d\x0a" else: c += bytes[i] i+=1 open(file, "wb").write(c)