覆盖源文件,注意备份- @echo off&setlocal enabledelayedexpansion
- set /p "目录=文件夹名称:"
- for /f "delims=" %%a in ('dir /s /b "%cd%\%目录%\*.txt"') do (
- (for /f "tokens=1-7*" %%b in ('type "%%a"') do (
- set s1=%%c
- set s2=%%h
- if "!s2:~-2!" equ "00" (set "s2=!s2:~,-2!")
- echo;%%b !s1:~,2!:!s1:~-2,2! %%d %%e %%f %%g !s2! %%i
- ))>"%%~dpa$"
- move "%%~dpa$" "%%a"
- )
- pause
复制代码
|