I've used the Python 3 code below to change files with names like:
CT-8873-0002 CT-8873-0003 ...
to names like
CT-008-0002.dcm CT-008-0003.dcm ...
But I need to change the names to the new names in the actual directory. Can't seem to do this. Tried many things.
from __future__ import print_function
import os
os.chdir('C:\\Users\\franc\\Desktop\\CT-INSPIRIUM-8873')
import glob
for fileName1 in glob.glob('CT-*'):
fileName1 = fileName1.split('-')
fileName1[1] = '008'
fileName1 = '-'.join(fileName1)
fileName2 = fileName1
print(fileName2)
Thanks