Read multiple text files line by line into a new file (that is, merging text files) (requires that empty lines, leading and trailing blanks in the file can be output as they are). I wrote one but the empty lines are ignored, and when encountering blank lines containing spaces or tabs, it writes "echo 已经关闭" to the file. I don't know how to solve these problems?
@echo off
setlocal EnableDelayedExpansion REM Enable delayed variables=%
dir/b/o:n *.txt>filelist.tmp REM Get file list=%
type.>HBfile.txt REM First create the result file=%
for /f "usebackq delims=" %%a in ("filelist.tmp") do ( REM Get a file name=%
set filename=%%a REM Assign the file name to the variable=%
call :sub !filename! REM Call the subroutine with parameters=%
)
del filelist.tmp REM Delete the temporary file after completion=%
goto :eof REM Exit=%
:sub
for /f "usebackq delims=" %%i in ("%1") do (
echo %%i>>HBfile.txt) REM Write the obtained content to the result file=%
echo.>>HBfile.txt REM Add a blank line after each file is completed=%
goto :eof REM Exit subroutine=%
@echo off
setlocal EnableDelayedExpansion REM Enable delayed variables=%
dir/b/o:n *.txt>filelist.tmp REM Get file list=%
type.>HBfile.txt REM First create the result file=%
for /f "usebackq delims=" %%a in ("filelist.tmp") do ( REM Get a file name=%
set filename=%%a REM Assign the file name to the variable=%
call :sub !filename! REM Call the subroutine with parameters=%
)
del filelist.tmp REM Delete the temporary file after completion=%
goto :eof REM Exit=%
:sub
for /f "usebackq delims=" %%i in ("%1") do (
echo %%i>>HBfile.txt) REM Write the obtained content to the result file=%
echo.>>HBfile.txt REM Add a blank line after each file is completed=%
goto :eof REM Exit subroutine=%
一个专搜注册信息的链接注册信息搜索--历史是一个旋转的车轮,它的轨迹总是那样的相似回复后可见
