Skip to content

Instantly share code, notes, and snippets.

@southpolemonkey
Last active May 17, 2019 03:54
Show Gist options
  • Save southpolemonkey/63870aa6cdc3954f9b8a2e2154f5d88f to your computer and use it in GitHub Desktop.
Save southpolemonkey/63870aa6cdc3954f9b8a2e2154f5d88f to your computer and use it in GitHub Desktop.
bulk filename rename
import os
import glob
i = 0
for file in glob.glob('<filepattern>'):
new_filename = 'example_' + str(i) + '.txt'
os.rename(file, new_filename)
# placeholder: filepattern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment