Files
Text-Modifier-pyscripts/script.py
2024-11-10 14:22:19 +01:00

11 lines
354 B
Python

# Read the file
with open("input.txt", "r", encoding="utf-8") as file:
lines = file.readlines()
# Remove duplicates by converting to a set, then back to list to keep the order
unique_lines = set(lines)
# Write the unique lines back to the file or a new file
with open("output.txt", "w", encoding="utf-8") as file:
file.writelines(unique_lines)