[go: up one dir, main page]

File: rewrite.py

package info (click to toggle)
libmongocrypt 1.1.0-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 4,348 kB
  • sloc: ansic: 23,634; cs: 2,921; python: 2,826; javascript: 1,736; java: 1,660; cpp: 814; sh: 474; makefile: 37
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()