I am trying to use DOS to filter lines from one file to another.
I have the list of registered dlls from a system in the file Regfiles_sys1.txt in this format:
junk1.dll {0000000} C:\Program Files\jnk\Junk1.dll [Junk 1.0 Type Library]
junk2.dll {0000000} D:\Program Files\jnk\Junk2.dll [Junk 2.0 Type Library]
junk3.dll {0000000} C:\Program Files\jnk\Junk3.dll [Junk 3.0 Type Library]
one.dll {0000000} D:\Program Files\jnk\one.dll [one Type Library]
I only want the c:\ records in the new output file.
This is my code snippet so far which does not work:
for /F "usebackq" %%i in (`dir /b regfiles_*.txt`) do (call :No_D %%~ni)
goto :EOF
:No_D
if {%1}=={} goto :EOF
if exist %1.tmp del %1.tmp
for /F "tokens=1,2* delims=}" %%i in (%1.txt) do (
if /i "%%j:~0,3%" NEQ " d:" (echo %%i}%%j>>%1.tmp)
)
goto :EOF
^John
P.S. I do not know how to use the delay translate (!) or if it will help here.