Created
April 21, 2020 05:12
-
-
Save uneasyguy/d779755a124299d87575649b83d7b9ac 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
import os | |
for root, dirs, files in os.walk(os.getcwd(), topdown=False): | |
for name in files: | |
if name.endswith(".csv") and name[4:7] == "-9-": | |
new_name = name.replace("-9-","-09-") | |
old_filepath = os.path.join(root, name) | |
new_filepath = os.path.join(root, new_name) | |
command = f'mv {old_filepath} {new_filepath}' | |
os.system(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment