标题: [求助]文本去掉空行
[打印本页]
作者: btpg
时间: 2010-7-4 10:19
标题: [求助]文本去掉空行
color a&title 文本去掉空行
setlocal enabledelayedexpansion
copy nul "%userprofile%\desktop\path.dat"
for %%a in (%*) do echo %%a>>"%userprofile%\desktop\path.dat"
for /f "usebackq delims=" %%a in ("%userprofile%\desktop\path.dat") do (
for /f "usebackq delims=" %%b in ("%%~a") do echo %%b>>"%%~dpna")
for /f "usebackq delims=" %%a in ("%userprofile%\desktop\path.dat") do (
set /a n+=1
set a!n!=%%~dpna
del %%a
)
for /l %%a in (1 1 %n%) do (
echo "!a%%a!"
ren "!a%%a!" "!a%%a!.txt"
)
del "%userprofile%\desktop\path.dat"
pause
这个是用来删除很多个txt文件中的空行,并把它们修改好后替换掉原来的文件,不知怎的,改名时无法定位到文件