aboutsummaryrefslogtreecommitdiffstats
path: root/linebreakremover/linebreakremover.py
diff options
context:
space:
mode:
Diffstat (limited to 'linebreakremover/linebreakremover.py')
-rw-r--r--linebreakremover/linebreakremover.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/linebreakremover/linebreakremover.py b/linebreakremover/linebreakremover.py
new file mode 100644
index 0000000..051aac3
--- /dev/null
+++ b/linebreakremover/linebreakremover.py
@@ -0,0 +1,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)