File: rewrite.py

package info (click to toggle)
libmongocrypt 1.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,572 kB
  • sloc: ansic: 70,067; python: 4,547; cpp: 615; sh: 460; makefile: 44; awk: 8
file content (16 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
help = """
Script to rewrite \n to \r\n
Usage: python3 rewrite.py file-in.txt file-out.txt
file-in.txt will be rewritten to have \n replaced with \r\n.
"""
import sys
if len(sys.argv) != 3:
    print (help)
    sys.exit(1)

src = open (sys.argv[1], "r")
dst = open (sys.argv[2], "w")
for line in src:
    print (line)
    dst.write(line.strip() + "\r\n")
dst.close()