New_name = new_file.replace(text_to_remove, '') Text_to_remove = " - ".strip('')įor count, filename in enumerate(os.listdir(folder)):įor count, new_file in enumerate(filenames): ![]() "C:/Users/Ronnie Atuhaire/Downloads/week b4/", "C:/Users/Ronnie Atuhaire/Downloads/Today/", "C:/Users/Ronnie Atuhaire/Downloads/Last week/", "C:/Users/Ronnie Atuhaire/Downloads/weeks b4/", For example, my goal was to remove " - "which automatically adds while downloading import osįolder_paths = [ "C:/Users/Ronnie Atuhaire/Downloads/", Here is the script! Make necessary changes to the specific folders and what you want to rename. If you have Python installed, you do not need to pip install anything! We shall be using the os module which comes pre-bundled in the standard library. ![]() ![]() Python came to my rescue and I now do monthly renaming at once with a simple running of my script in seconds. I personally use Y2mate and I am usually lazy going from one file to another and removing the -y2mate extension. Hi there□, do you download videos from Youtube, and do you have a hard time renaming them since they come with the downloader tool's name appended to the name?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |