回复 5# dml1 - @echo off
- setlocal enabledelayedexpansion
- cd /d "D:\txt所在文件夹"
- set "fdir=D:\目标文件夹"
- if not exist "%fdir%" md "%fdir%"
- for /f "delims=" %%a in ('dir /b *.txt') do (
- set n=1
- for /f "tokens=1* delims=:" %%b in ('findstr /n .* "%%a"') do (
- if !n! ==1 >"%fdir%\new_%%a" echo %%c
- if !n! gtr 7 if !n! lss 13 >>"%fdir%\new_%%a" echo %%c
- set /a n+=1
- )
- )
- pause
复制代码
|