author | francesco-ST <francesco.abbate@st.com> | 2010年12月30日 11:40:11 +0100 |
---|---|---|
committer | francesco-ST <francesco.abbate@st.com> | 2010年12月30日 11:40:11 +0100 |
commit | 7f73acc24c47f7e0ef6f367db12a184a23e5faa2 (patch) | |
tree | f248567fca623fe45f3c35b5acbd19011485f099 /scripts/unix2dos.py | |
parent | ae6927261f68ee7b5149be6d225807370069beb2 (diff) | |
download | gsl-shell-7f73acc24c47f7e0ef6f367db12a184a23e5faa2.tar.gz |
-rw-r--r-- | scripts/unix2dos.py | 19 |
diff --git a/scripts/unix2dos.py b/scripts/unix2dos.py new file mode 100644 index 00000000..e7e822b6 --- /dev/null +++ b/scripts/unix2dos.py @@ -0,0 +1,19 @@ +import sys +import os + +for fn in sys.argv[1:]: + new_name = fn + ".new_" + + fin = open(fn, "rb") + fout = open(new_name, "wb") + + for line in fin: + nline = line.replace("\n", "015円\n") + fout.write(nline) + + fin.close() + fout.close() + + os.remove(fn) + os.rename(new_name, fn) + |