Last active
July 22, 2020 04:08
-
-
Save Marceeaax/3bb56863917e3b7872d043ae69c5f921 to your computer and use it in GitHub Desktop.
This file contains 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
#Python script that renames files by removing a specific common pattern among them | |
import os | |
for every in os.scandir(): #loop through all files in current directory | |
if every.name.startswith('y2mate'): #if file matches the pattern | |
os.rename(every.name,every.name.replace('y2mate.com - ', '')) #rename file | |
print(every.name) #shows filenames | |
input("Archivos renombrados !!!") #this command prevents python from closing immediately |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment