- @echo off
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- set n=0
- (for /f "tokens=1* delims=:" %%j in ('findstr /n .* "%%i"') do (
- if defined n (
- if not "%%k"=="" (
- for /f "tokens=* delims= " %%l in ("%%k") do (
- echo,%%l
- set n=
- )
- )
- ) else (
- echo,%%k
- )
- ))>New_%%i
- )
- pause
复制代码
|