hackf 当前离线
二级士官
评分人数
原帖由 asnahu 于 2009-10-8 21:10 发表 如果要保留空行,楼主应该事先说明。更新: @echo off & setlocal enabledelayedexpansion set m=1 for /f "delims=" %%i in (a.txt) do ( for /f "delims=" %%a in ('findstr /n .* b.txt') do ( ...
TOP
asnahu 当前离线
中尉
@echo off & setlocal enabledelayedexpansion set m=1 for /f "delims=" %%i in (a.txt) do ( for /f "delims=" %%a in ('findstr /n .* b.txt') do ( set foo=%%a set foo=!foo:*:=! if not "!foo!"=="3" (echo/!foo!) else (echo/%%i) )>>!m!.txt set /a m+=1 ) pause>nul复制代码
Seter (.De Le Te.)当前离线
技术组成员
原帖由 asnahu 于 2009-10-8 12:49 发表 问题一次说清楚: @echo off & setlocal enabledelayedexpansion set m=1 for /f "delims=" %%i in (a.txt) do ( for /f "delims=" %%a in (b.txt) do ( set "foo=%%a" ...
@echo off & setlocal enabledelayedexpansion set m=1 for /f "delims=" %%i in (a.txt) do ( for /f "delims=" %%a in (b.txt) do ( set "foo=%%a" set foo=!foo:3=%%i! echo/!foo! )>>!m!.txt set /a m+=1 ) exit复制代码
原帖由 asnahu 于 2009-10-8 12:30 发表 @echo off & setlocal enabledelayedexpansion set n=0 set m=1 for /f "delims=" %%i in (a.txt) do ( for /f "delims=" %%a in (b.txt) do ( set /a n+=1 if not ! ...
@echo off & setlocal enabledelayedexpansion set n=0 set m=1 for /f "delims=" %%i in (a.txt) do ( for /f "delims=" %%a in (b.txt) do ( set /a n+=1 if not !n! equ 3 (echo/%%~a) else (echo/%%~i) )>>!m!.txt set n=0 set /a m+=1 ) exit复制代码
原帖由 Seter 于 2009-10-8 12:07 发表 继续提问 53,35,535这样的替换吗? 若替换,字符5仍然保存么
原帖由 Seter 于 2009-10-8 11:24 发表 题意不清,什么叫"依次把3替换"?