Created
November 30, 2022 10:43
-
-
Save aahnik/cae1934bfca9077cddadec3349a9c9a0 to your computer and use it in GitHub Desktop.
Python Script to add suffix to all your files
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
import os | |
SUFFIX = "S20220010001" # replace with your suffix | |
for item in os.listdir(): | |
fname, ext = item.split(".") | |
if not fname.endswith(SUFFIX): | |
fname += f"_{SUFFIX}" | |
os.rename(item, fname + "." + ext) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment