Skip to content

Instantly share code, notes, and snippets.

@MikSDigital
Created March 27, 2018 08:34
Show Gist options
  • Save MikSDigital/2c9bd8721ba0b122383079c0dcf103b3 to your computer and use it in GitHub Desktop.
Save MikSDigital/2c9bd8721ba0b122383079c0dcf103b3 to your computer and use it in GitHub Desktop.
Removes symbols (spaces) from filenames in folder
import os
path = os.getcwd()
filenames = os.listdir(path)
for filename in filenames:
print(filename)
os.rename(os.path.join(path, filename), os.path.join(path, filename.replace('---', '-')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment