本帖最后由 DAIC 于 2015-1-20 13:39 编辑
把第一行移动到最后一行:- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- set /p firstLine=<"%%i"
- more +1 "%%i" >"%%i.new"
- >>"%%i.new" echo,!firstLine!
- move /y "%%i.new" "%%i"
- )
复制代码 把第一行复制到最后一行:- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- set /p firstLine=<"%%i"
- type "%%i" >"%%i.new"
- >>"%%i.new" echo,!firstLine!
- move /y "%%i.new" "%%i"
- )
复制代码
|