回复 8# kokoxx - @echo off
- chcp 65001>nul
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- (for /f "tokens=1* delims=:" %%a in ('findstr /n .* "%%i"') do (
- if "%%b"=="" (
- echo,
- ) else (
- for /f "tokens=1,2* delims=0123456789 " %%j in ("%%b") do (
- if "%%j%%k"=="第章" (
- if "%%l"=="此行不做添加空行处理" (
- echo,%%b
- ) else (
- echo,
- echo,
- echo,
- echo,%%b
- echo,
- echo,
- echo,
- )
- ) else (
- echo,%%b
- )
- )
- )
- ))>temp
- move "temp" "%%i"
- )
- pause
复制代码
|