I have a question based where I need to write a batch file that will process all text files in a directory and rename the files based on a string in the first line of the text file. I searched the other answers here and they come close but dont match what im looking to do.
My experience is limited to basic cmd prompt batch file writing.
Directory of files c:\incoming\
Sample file name#1 RPT0001.summary.txt
Sample file name #2 RPT0002.summary.txt
Sample content of first line of file:
HDRABCEDF123456789020110101 (Where HDR=Constant , ABCDEF = Variable client,1234567890 = Variable file tag, 20110101= variable date)
I need the outputfilename to go from RPT0001.summary.txt to ABCDEF123456789020110101.summary.txt
I need it to cycle through for each file in the folder.
Any help would be greatly appreciated.