To fix: copy this file to "fixcel.py"
# fixcel.py
from sys import argv
infnam, outfnam = argv[1:]
inf = file(infnam)
indata = inf.read()
inf.close()
outdata = ""
for ch in indata:
if ord(ch) == 13:
outdata += "\n"
else:
outdata += ch
outf = file(outfnam,"w")
outf.write(outdata)
outf.close()
#
Then invoke with:
python fixcel.py oldfilename newfilename
2 comments:
No idea why this is double spaced.
It works if you just paste it despite the extra line feeds.
Be sure to keep the indentation of the lines after "if" and "else" and make sure they are indented by the same number of spaces.
Post a Comment