- @echo off&setlocal enabledelayedexpansion
- set filename="data.txt"
- set "find=findstr /ic:"User name" /c:"User access PeVlan/CeVlan""
- for /f "tokens=1* delims=:" %%i in ('%find% %filename%')do (
- if defined str (
- echo !str!,%%j
- set str=
- ) else set str=%%j
- )
- pause
复制代码
|