I am trying to get the list of files having specific extension along with their version and store it in a text file. However, I wont get the desired output. The text file will show all the file's list in the folder.
@echo off
for %%f in (*.drw) do (
if "%%~xf"==".drw" echo %%f
)
dir /b > files.txt
echo. & echo.
I am trying to extract the list of all files which will have extension in the form of:
test.drw.1
flange.drw.1
block.drw.2
hinge.drw.3
door.drw.1
The text file will show all the lists of the file (.pdf, .pro,.dwg,.asm). Is there something I am missing ? Or this is occurring because the programs tries to scan .drw extension stringently, and considers .1 and .2 as extensions and skips them ? Any help is appreciated.
Additionally, I would be grateful, if we are able to echo the file having the extension with highest version. E.g.
flange.drw.1
flange.drw.12
It should echo flange.drw.12
in the txt file and ignore the one with .drw.1