Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I want to compare two lists.
In list1.txt are the Pc names where the job is done.
In list2.txt are all pcs where the job must be done.
result.txt should be a list whith the pcs where the job isn´t yet done.
My batch isn´t really working:
FOR /f "skip=2 tokens=1,4*" %%a in ('find "PC" list1.txt') do find "PC" <list2.txt | find/v "%%b" >>result.txt
Lists it as many times a pcs are in list1.txt without the one which is in %%b
...>result.txt
Lists it only without the last PC of list1.txttnx in advance for any help
uli

Hi,
Try thios:
::**
:: Uses DONE and ALLJOBS to make TODO@echo off > todo.txt
:main
for /f "tokens=* delims=" %%J in ('type ALLJOBS.TXT') do call :todo-r %%J
goto :eof:todo-r
find "%1" < DONE.TXT > nul
if errorlevel 1 echo %1 >> TODO.TXTM2
If at first you don't succeed, you're about average.

HOLD ON.
This is not working right on some files.
I'm working on it.
M2
If at first you don't succeed, you're about average.

Try this:
::**
:: Uses DONE and ALLJOBS to make TODO
:: The :~0,-1 is needed to get rid of a traling space@echo off > todo.txt
:main
for /f "tokens=* delims=" %%J in ('type ALLJOBS.TXT') do set line=%%J & call :todo-r
goto :eof:todo-r
find "%line:~0,-1%" < DONE.TXT > nul
if errorlevel 1 echo %line:~0,-1% >> TODO.TXT
::**
M2
If at first you don't succeed, you're about average.

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

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