62,244
社区成员




@echo off
set n=1
:3
if exist d:\new_%n%.txt (set /a n+=1&goto 3)
set file=%1
for /f "usebackq delims=" %%i in ("%file%") do (
echo.%%i >>d:\new_%n%
)
echo
处理完毕!
@echo off
set n=1
set file=%1
:4
for /f "delims=" %%a in ("%file%") do (
set o=%%~dpna_%n%%%~xa
)
if exist "%o%" (set /a n+=1&goto 4)
for /f "delims=" %%a in ("%file%") do (
set o=%%~dpna_%n%%%~xa
)
findstr "[\s]" %file% >> "%o%"
echo 文件%file%处理后已另存为%o%。
@echo off
set file=%1
findstr "[\s]" %file% >> d:\new_"%file%"
文件名的规则你参照你之前的逻辑即可。