cc.txt保存的是aa.txt中没有的项,dd.txt 保存的是bb.txt不存在的项,dd.txt保存的是相同的项,ff.txt保存的是去除了相同项的文件.- @echo off
- set "Afile=aa.txt"
- set "Bfile=bb.txt"
- (for /f "delims=" %%a in ('type "%Bfile%"') do find "%%a"<"%Afile%">nul||echo;%%a)>cc.txt
- (for /f "delims=" %%a in ('type "%Afile%"') do find "%%a"<"%Bfile%">nul||echo;%%a)>dd.txt
- (for /f "delims=" %%a in ('type "%Afile%"') do find "%%a"<"%Bfile%")>ee.txt
- copy cc.txt+dd.txt+ee.txt ff.txt
- pause
复制代码
|