I have HTML files named as follows:
/content
diagram113660819130 - PREPAY AUDIT-content.html
diagram126591269210 - CAS MAIN-content.html
Image files named as follows:
/images
diagram1136608191.pdf
diagram1265912692.pdf
I want to rename the .pdf using the HTML file names
REN diagram1136608191.pdf 30 - PREPAY AUDIT.pdf
REN diagram1265912692.pdf 10 - CAS MAIN.pdf
The pdf name may be 16 or 17 characters long.
I am stuck with the following code
@echo off
del digfiles.txt
dir diagram*-content.html /B /O :N >digfiles.txt
FOR /F "tokens=1, 2, 3*" %%i in (digfiles.txt) do (
echo %%i %%j %%k %%l
echo.%i:~0,16%
dir ..\images\%%i:~0,16%*.pdf
)
I cannot get it to echo the first 16 characters
neither can I get the directory listing of the giveb pdf.
I am far from doing the rename if I cannot even seperate the first 16 characters...please help.
