DOS read file

Here is what I want to do:

I have some HTML files with names like
/content folder
diagram113660819130 - PREPAY AUDIT-content.html
diagram126591269210 - CAS MAIN-content.html

I have some image files with names

I want to rename the .pdf files as follows:
ren diagram1136608191.pdf 30 - PREPAY AUDIT.pdf
ren diagram1265912692.pdf 10 - CAS MAIN.pdf

I have code as follows:

@echo off
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

here is my output
diagram113660819130 - PREPAY AUDIT-content.html

I am unable to get the first 16 characters of i. Also it is not always that the .pdf is 16 characters it could be 17 too.

Can someone help me accomplish what I am trying to do. Thanks in advance for your help.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!