- @echo off
- setlocal enabledelayedexpansion
- (for /f "tokens=1* delims=:" %%i in ('findstr /n ".*" a.txt') do (
- set "line=%%j"
- if "!line!" neq "" (
- if "!line:address=!" neq "!line!" (
- echo address=beijing
- ) else (
- echo,%%j
- )
- ) else (
- echo,
- )
- ))>b.txt
复制代码
|