本帖最后由 qixiaobin0715 于 2024-1-26 10:34 编辑
回复 1# yyz219
纯P试试:- @echo off
- chcp 65001 >nul
- set /p x=Please enter the specified line number:
- set /a m=x-1
- (for /f "delims=" %%i in (1.txt) do (
- if defined Line4 echo,!Line4!
- for /l %%j in (%m%,-1,1) do (
- set /a n=%%j+1
- set Line!n!=!Line%%j!
- )
- set line1=%%i
- )
- if defined Line4 (
- type 2.txt
- for /l %%i in (%x%,-1,1) do echo,!Line%%i!
- ))>3.txt
- pause
复制代码
|