added utility scripts and fixed CR/LF problems - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/scripts/unix2dos.py
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年12月30日 11:40:11 +0100
committerfrancesco-ST <francesco.abbate@st.com>2010年12月30日 11:40:11 +0100
commit7f73acc24c47f7e0ef6f367db12a184a23e5faa2 (patch)
treef248567fca623fe45f3c35b5acbd19011485f099 /scripts/unix2dos.py
parentae6927261f68ee7b5149be6d225807370069beb2 (diff)
downloadgsl-shell-7f73acc24c47f7e0ef6f367db12a184a23e5faa2.tar.gz
added utility scripts and fixed CR/LF problems
Diffstat (limited to 'scripts/unix2dos.py')
-rw-r--r--scripts/unix2dos.py 19
1 files changed, 19 insertions, 0 deletions
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)
+
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月15日 04:55:45 +0000

AltStyle によって変換されたページ (->オリジナル) /