Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

rename files in python

# for multiple files
import os

for dirname in os.listdir("."):
	print((dirname[:-4]).zfill(6)+'.txt')
	os.rename(dirname, (dirname[:-4]).zfill(6)+'.txt')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rename #files #python
ADD COMMENT
Topic
Name
5+9 =