Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi All,
I'm monitoring log files of testcases. I have a batchfile for processing these logfiles and in this batchfile, I have implemented to dump all filenames to a testfile: "dirlist.txt".
I'm trying to implement a solution where the batchfile will only process the files that are NOT in the "dirlist.txt".
I have tried to find someting like following:
for /f "tokens=* delims= " %%a in ('dir/b "C:\Scripts\Mercury\Logs\TE_*.log"') do (
if %%a not in ("C:\Scripts\Mercury\dirlist.txt") (
commands....
)I have tried using various 'find' statements, but I cannot get it solved.
Agan, any help will be greatly appreciated!
Thanks in advance!
Igor

for /f "tokens=* delims= " %%a in ('dir/b "C:\Scripts\Mercury\Logs\TE_*.log"') do (
find "%%a" < C:\Scripts\Mercury\dirlist.txt > nul
if errorlevel 1 echo commands....
)
=====================================
If at first you don't succeed, you're about average.M2

not really sure what you are doing, but findstr can take in wildcards as filenames.
findstr /M "test" *.txt
the above command finds all text files that have "test" in them. Check findstr /? for more info. Also, the /D option might be interesting for you.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |