Apr-17-2019, 01:53 PM
(Apr-17-2019, 12:00 PM)shankar455 Wrote: Kindly suggest me script .I don't work like this here,you have to show some effort
Can give some hint that should take you close if put together.
import os path = r'some_path' for file in os.scandir(path): if file.name.endswith('.txt'): # Do something to all .txt
>>> import re >>> >>> today = '04172019' >>> s = 'Siva_mourya_02242019_nd.txt' >>> re.sub(r'\d+', today, s) 'Siva_mourya_04172019_nd.txt'