rem 找出source.txt 里有的,而target.txt 里每行没有的内容并记录到result.txt里面
@echo off
rem
rem 参数设置
rem 结果文件
set result=result.txt
rem 来源的文件
set source=source.txt
rem 对照文件
set target=target.txt
rem 临时文件
set temp=temp.txt
rem 查找对比字符串
set findd=---------- %target%: 0
rem 调用1bat
set bat1=bat1.bat
rem 调用2bat
set bat2=bat2.bat
rem 调用3bat
set bat3=bat3.bat
rem 清除结果文件
if exist %result% del %result%
rem 生成第1个临时调用文件
echo @echo off>%bat1%
echo for /f %%%%a in (%source%) do %bat2% %%%%a>>%bat1%
echo del bat3.bat>>%bat1%
rem echo exit>>%bat1%
echo @echo off >%bat2%
echo find /c "%%1" %target% ^>%temp%>>%bat2%
echo %bat3% %%1>>%bat2%
rem echo exit>>%bat2%
echo @echo off >%bat3%
echo for /f "delims=xxx" %%%%i in (temp.txt) do if /i "%%%%i"=="%findd%" echo %%1^>^>%result% >>%bat3%
rem echo exit>>%bat3%
echo @echo off >清除.bat
echo @del %bat1% %bat2% %bat3% %temp% 清除.bat>>清除.bat