Im trying to add a “.” after the last occurrence of a integer starting backwards from “.html”
python
import os
import glob
import re
for name in glob.glob('*.html'):
newname = re.compile('name(.*?)(\d+)')
os.rename(name, newname)
change filenames from:
1cor12.html
gen1.html
to:
1cor.12.html
gen.1.html
Something like should do: