- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /b *.txt') do (
- for /f "skip=1 tokens=1,2 delims= " %%b in (a.txt) do (
- set n=
- if "%%a"=="%%b.txt" (
- for /f "delims=" %%d in ('type %%b.txt') do (
- set /a n+=1
- if !n!==5 (echo;%%c>>%%b000.txt
- ) else (echo;%%d>>%%b000.txt)
- )
- del "%%b".txt
- ren "%%b000".txt "%%b".txt
- )
- )
- )
- pause
复制代码 请帮忙改一下这段代码。在论坛里找到的,但不会改。 |