本帖最后由 lifei259 于 2017-11-11 10:41 编辑
- @echo off&setlocal EnableDelayedExpansion
- for /f "delims=" %%I in ('dir/a/b/a-d,*.rar *.zip') do (echo,%%I
- winrar x -o+ %%I *.txt
- for /f "delims=" %%a in ('dir/a/b,"*.txt" ') do (set "txt=%%a"
- set "n=0"
- for /f "delims=" %%b in ('type,"%%a"^|findstr /n .* ') do (
- for /f " delims=:" %%c in ("%%b") do (set "a=%%c"
- )
- set /a "a=!a!-4"
- echo,kkkkkkkkk>$
- echo,kkkkkkkkkkkk>>$
- for /f "skip=2 tokens=1* delims=:" %%j in ('type,"!txt!"^|findstr /n .* ') do (
- set /a n+=1
- echo,%%k>>$
- if !n!==!a! (goto:1)
- )
- )
- :1
- echo,wwwwwwwwww>>$
- echo,wwwwwwwwwwwwww>>$
- del /a /f /q "!txt!"
- move $ "!txt!"
- winrar a "%%I" "!txt!"
- del /a /f /q "!txt!"
- )
- )
- pause
- exit
复制代码 有几个TXT文件,替换的内容是否一样 |