This commit is contained in:
2023-01-04 17:12:09 -03:00
parent b48012bfa3
commit 5d7d125521

View File

@ -1,9 +1,9 @@
# This diffs two csv files, It's useful for mods and stuff.
# Nevermind, I suggest deleting all the files in the scripts folder when generating the dialogue file instead.
# But I'm sure someone might find a use for this
#... I haven't actually tried this yet, it might work, it might not.
# If it doesn't. Call my number (It's hidden in your ear!).
def main():
# Open the input files
file1 = open("file1.csv", "r", encoding="utf8")
file2 = open("file2.csv", "r", encoding="utf8")
@ -21,17 +21,11 @@ def main():
lines2 = set(text2)
# Calculate the difference between the sets
if len(lines1) > len(lines2):
diff = lines2.difference(lines1)
else:
diff = lines1.difference(lines2)
# Open the output file
output_file = open("diff.csv", "w", encoding="utf8")
# Write the difference to the output file
with open("diff.csv", "w", encoding="utf8") as ofile:
for line in diff:
output_file.write(line)
# Close the output file
output_file.close()
if __name__ == "__main__":
main()
ofile.write(line)