Batch file 使用批处理文件将文本从一个文件提取到新文件中

Batch file 使用批处理文件将文本从一个文件提取到新文件中,batch-file,Batch File,我有一个包含100多个文件的文件夹,这些文件中包含文本。我使用这个.bat代码将某些文本提取到另一个文本文件中 SETLOCAL (FOR /L %%i IN (1,1,3) DO SET /P line=) < math.txt > lines.txt ECHO %line% ENDLOCAL 好的,您似乎需要知道FOR命令来选择要读取的文件(the.txt),但只需要 type (insert input dir here) >> (insert ouput dir

我有一个包含100多个文件的文件夹,这些文件中包含文本。我使用这个.bat代码将某些文本提取到另一个文本文件中

SETLOCAL
(FOR /L %%i IN (1,1,3) DO SET /P line=) < math.txt > lines.txt ECHO %line%
ENDLOCAL

好的,您似乎需要知道FOR命令来选择要读取的文件(the.txt),但只需要

type (insert input dir here) >> (insert ouput dir here)
type (insert input dir here) >> (insert ouput dir here)