Created
March 23, 2025 03:00
-
-
Save dbiesecke/4f73569ffc62da7c056ef28af846e18d to your computer and use it in GitHub Desktop.
Umlate entfernen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
umlauts = { | |
"Ã":"Ü","ö":"oe","Ã":"ss","ä":"ä", "ü":"ü","ä":"ä", "ä": "ae", "ö": "oe", "ü": "ue", "ß": "ss", | |
"Ä": "Ae", "Ö": "Oe", "Ü": "Ue" | |
} | |
def rename_files(): | |
for filename in os.listdir("."): | |
newname = filename | |
for umlaut, replacement in umlauts.items(): | |
newname = newname.replace(umlaut, replacement) | |
if filename != newname: | |
os.rename(filename, newname) | |
print(f"Renamed: {filename} → {newname}") | |
rename_files() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment