@echo off
for /f "delims=" %%a in (1.txt 2.txt) do (
if defined @%%a (echo>>重复.txt %%a) else echo>>不重复.txt;%%a
set @%%a=.
)
pause
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in ('"type 1.txt 2.txt 2>nul|sort"') do (
if %%a==!last! (
echo>>重复.txt !repeat!
) else (
echo>>不重复.txt %%a
set last=%%a
)
)
pause
@echo off
sort 1.txt>1.$
sort 2.txt>2.$
fc 1.$ 2.$
pause
@echo off&setlocal enabledelayedexpansion
set $=$
for /f "delims=" %%a in (1.txt 2.txt) do (
if "!$%%a=!"=="!$!" (echo>>不重复.txt %%a) else echo>>重复.txt %%a
set $=!$!$%%a
)
pause