本帖最后由 buyiyang 于 2023-6-21 14:15 编辑
受http://www.bathome.net/viewthread.php?tid=43845启发,用比较二进制的方法写了一个- @echo off
- call :diff "yuanshi.txt" "new.txt"
- pause&exit
- :diff
- echo,>>%1&echo,>>%2
- for %%i in (%1 %2) do (
- fsutil file creATenew "new_%%~i" %%~zi >nul
- (for /f "tokens=2" %%a in ('fc /b %%i "new_%%~i" ^| findstr /irc:"[0-9A-F]*: [0-9A-F][0-9A-F] 00"') do (
- set /p=%%a
- if /i "%%a"=="0A" echo,
- ))<nul >"new-%%~i"
- del "new_%%~i"
- )
- findstr /ivxg:"new-%~1" "new-%~2" >result.txt
- del "new-%~1" "new-%~2"
- certutil -decodehex -f result.txt result.txt
复制代码
|