本帖最后由 apang 于 2012-10-1 13:39 编辑
- @echo off
- set "AA=Bat"
- set "BB=123^|456^|789"
- (for /f "tokens=1* delims=:" %%a in ('findstr /n .* a.txt') do (
- set "str=%%b"
- setlocal enabledelayedexpansion
- if /i not "!str:~,3!"=="IP=" (
- if /i not "!str:~,5!"=="文件ID=" (echo,!str!
- ) else echo,文件ID=%BB%
- ) else echo,IP=%AA%
- endlocal
- ))>b.txt
复制代码
|