I have a folder that has a mix and match of camelCase and non camel case filenames. I have used this in Python to remove underscores and was hoping I could easily tweak it to replace 'camelCaseExample' with 'camel Case Example':
folder = r"C:/....."
import os
pathiter = (os.path.join(root, filename)
for root, _, filenames in os.walk(folder)
for filename in filenames
)
for path in pathiter:
newname = path.replace('_', ' ')
if newname != path:
os.rename(path,newname)
Could anyone help me edit this to get it working for regex?
I have tried this with no luck:
newname = path.replace('%[A-Z][a-z]%', ' ')
I would also be able to use a c# solution if that would be easier