Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -199,10 +199,11 @@ def merge_lines(doc1, doc2, doc3, doc4):
|
|
| 199 |
merged_lines = []
|
| 200 |
|
| 201 |
with open("merged_lines.txt", "w") as f:
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
|
|
|
| 206 |
|
| 207 |
return merged_lines
|
| 208 |
|
|
|
|
| 199 |
merged_lines = []
|
| 200 |
|
| 201 |
with open("merged_lines.txt", "w") as f:
|
| 202 |
+
with [open(doc) for doc in docs] as handles:
|
| 203 |
+
for lines in zip(*handles):
|
| 204 |
+
merged_line = "".join(line.strip() for line in lines)
|
| 205 |
+
f.write(merged_line + "\n")
|
| 206 |
+
merged_lines.append(merged_line)
|
| 207 |
|
| 208 |
return merged_lines
|
| 209 |
|