像这样把第一层循环屏蔽掉也可正常输出结果,弄不懂了。- @echo off & setlocal enabledelayedexpansion
- pushd %tmp%
-
- set "启始行=:样本"
- for /f "tokens=1 delims=:" %%i in ('findstr /n /r ^!启始行! %~s0') do (set /a "nTag=%%i")&if defined nTag (># more +!nTag! %~s0) else goto :end
-
- set Lf=^
-
-
- REM for /f %%a in ('copy /z "%~0" nul') do
- for %%b in ("!Lf!") do (
- (for /f "delims=" %%c in (#) do (
- set "s=%%c"
- echo,原字符串 : !s!
- set "s=!s:/=/%%a%%~b处理后值 : !"
- echo,处理后值 : !s!
- ))>$
- )
- findstr "[^/]$" $
- del /f $ #
-
- :end
- popd
- pause & goto :EOF
-
-
- :样本
- http://www.bathome.net/post.php?action=newthread&fid=5
- http://www.bathome.net/c/3553908420
复制代码
|