aboutsummaryrefslogtreecommitdiffstats
path: root/linebreakremover/linebreakremover.py
blob: 051aac3b5a6a9c129c2ca1e0299ec628002acc13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
import re

try:
    input_path = sys.argv[1]
    output_path = sys.argv[2]
except IndexError:
    print("You need to specify the path to the .rot file as the first parameter and the output file path as the second parameter e.g. python linebreaker.py Rotation.rot output.rot")
    exit(-1)

with open(input_path, "r") as f:
    input_ = f.read()

output = re.sub(r"\n{2,}", "\n", input_)

with open(output_path, "w") as f:
    f.write(output)