This commit is contained in:
alzer
2025-05-15 21:36:04 +02:00
parent b327aa5c23
commit 0bcbc29f0f
8 changed files with 193 additions and 112 deletions
+21
View File
@@ -0,0 +1,21 @@
import json
import os
# Verzeichnis mit den übersetzten Dateien
input_directory = "actors_split_translated"
output_file = "wfrp4e-eis-actors-merged.json"
# Alle übersetzten Dateien finden
merged_actors = {}
for file_name in os.listdir(input_directory):
if file_name.endswith(".json"):
file_path = os.path.join(input_directory, file_name)
with open(file_path, 'r', encoding='utf-8') as file:
data = json.load(file)
merged_actors.update(data)
# Gesamte Datei speichern
with open(output_file, 'w', encoding='utf-8') as out_file:
json.dump(merged_actors, out_file, ensure_ascii=False, indent=4)
print(f"{len(merged_actors)} Einträge erfolgreich zusammengeführt.")