日期:2014-05-17 浏览次数:21195 次
@echo off rem 假设待处理的txt文件位于C:\test文件夹下 cd /d "C:\test" for /f "delims=" %%a in ('dir /s /b "*.txt"') do ( type nul >"%%~na.new" for /f "usebackq delims=" %%h in ("%%a") do ( >>"%%~na.new" echo,%%h,%%~na ) ) for %%a in (*.new) do ( move "%%a" "%%~na.txt" )