放在文本文件同目录下执行,生成新文件 new_原文件名.txt- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir/b *.txt') do (
- for /f "usebackq skip=1 tokens=1-3* delims=/" %%j in ("%%i") do (
- if not exist "new_%%i" (
- set/p first=<"%%i"
- echo !first!>"new_%%i"
- )
- echo %%j//%%k//?//%%m>>"new_%%i"
- )
- )
- pause
复制代码
|