Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -198,10 +198,12 @@ def merge_lines(doc1, doc2, doc3, doc4):
|
|
198 |
docs = [doc1, doc2, doc3, doc4]
|
199 |
merged_lines = []
|
200 |
|
201 |
-
with open(
|
202 |
-
|
|
|
|
|
203 |
merged_line = "".join(line.strip() for line in lines)
|
204 |
-
|
205 |
merged_lines.append(merged_line)
|
206 |
|
207 |
return merged_lines
|
|
|
198 |
docs = [doc1, doc2, doc3, doc4]
|
199 |
merged_lines = []
|
200 |
|
201 |
+
with open(doc1, "r") as f1, open(doc2, "r") as f2, \
|
202 |
+
open(doc3, "r") as f3, open(doc4, "r") as f4, \
|
203 |
+
open("merged_lines.txt", "w") as f_out:
|
204 |
+
for lines in zip(f1, f2, f3, f4):
|
205 |
merged_line = "".join(line.strip() for line in lines)
|
206 |
+
f_out.write(merged_line + "\n")
|
207 |
merged_lines.append(merged_line)
|
208 |
|
209 |
return merged_lines
|