返回列表 发帖
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in ('dir /a-d/s/b ^|findstr /i /r ".txt .asp .htm .html"') do (
set/a n=0&set "file_path=%%a"
for /f "delims=" %%i in ('type "%%a"') do set/a n+=1&&set "line[!n!]=%%i"
call set "line[0]=%%line[!n!]%%"&set/a n-=1
(for /l %%b in (0,1,!n!) do call echo !line[%%b]!)>"%%a"
)
pauseCOPY

TOP

本帖最后由 yhcfsr 于 2018-3-14 16:56 编辑

回复 4# kissbzm


   bat 放E盘就行了,作用是,运行一次,把文件最后一行移至最开头。
强调一下,先在其它地方测试一下,因这个脚本会更改源文件,一定要备份源文件,否则后果不堪设想。

TOP

返回列表