本帖最后由 /zhqsystem/zhq 于 2016-1-20 14:16 编辑
回复 1# ndyo
- @echo off&(setlocal enabledelayedexpansion)>nul 2>nul
- for /f "delims=" %%i in ('type ".\1.txt"')do (
- for /f "delims=" %%j in ("%%i")do (set "#name#=%%j"
- for /l %%k in (0,1,8192)do if /i "!#name#:~%%k,1!"=="<" set/a "m+=1"
- for /l %%k in (0,1,8192)do if /i "!#name#:~%%k,1!"==">" set/a "n+=1"
- if /i "!m!"=="!n!" (
- for /l %%k in (1,1,!m!)do (
- if not defined #name_l# for /f "delims=<" %%l in ("%%j")do set "#name_l#=%%l"
- for /f "tokens=1,* delims=<" %%l in ("!#name#!")do (set "#name#=%%m"
- for /f "tokens=1,* delims=<" %%n in ("!#name#!")do (set "#name_n#=%%n"
- if /i "!#name_n#:~0,1!"=="/" (
- set "#name_new#=!#name_new#!bathome.net^<%%n"
- )else (
- set "#name_new#=!#name_new#!^<%%n"
- )
- set "#new#=!#name_l#!bathome.net!#name_new#!"
- )
- )
- )
- )else (
- (echo,自动应答错误原始值:%%j)
- )
- set "#new#=!#new#!"
- if defined #new# (
- (echo,!#new#!)
- )
- set "#name_l#="&set "#name_new#="&set "new="&set "m="&set "n="
- echo/
- )
- )
- pause
复制代码
- @echo off&(setlocal enabledelayedexpansion)>nul 2>nul
- for /f "delims=" %%i in ('type ".\1.txt"')do (
- for /f "delims=" %%j in ("%%i")do (set "#name#=%%j"
- for /l %%k in (0,1,8192)do if /i "!#name#:~%%k,1!"=="<" set/a "m+=1"
- for /l %%k in (0,1,8192)do if /i "!#name#:~%%k,1!"==">" set/a "n+=1"
- if /i "!m!"=="!n!" (
- for /l %%k in (1,1,!m!)do (
- for /f "tokens=1,* delims=<" %%l in ("!#name#!")do (set "#name#=%%m"
- for /f "delims=>" %%l in ("!#name#!")do (set "#name_l#=%%l"
- if /i "!#name_l#:~0,1!"=="/" (
- set "new=!new!bathome.net^<%%l^>"
- )else (
- set "new=!new!^<%%l^>"
- )
- )
- )
- )
- )else (
- (echo,自动应答错误原始值:%%j)
- )
- if defined new (
- (echo,!new!)
- )
- set "new="&set "m="&set "n="
- echo/
- )
- )
- pause
复制代码
|