a guest Mar 18th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import os
- def remove_first_part_of_filenames(file_folder, size_str):
- for path, subdirs, files in os.walk(file_folder):
- for name in files:
- print("filename: %s" % name[len(size_str):])
- os.rename(os.path.join(path,name), os.path.join(path, name[len(size_str):]))
- file_folder = "C:\\Users\\gmasetti\\Dropbox\\ifremer\\renamed\\ascii"
- size_str = "survey_supporter_2016-260_"
- remove_first_part_of_filenames(file_folder=file_folder, size_str=size_str)
RAW Paste Data