Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 如何选择名称上有日期的所有文件?_File_Date_Batch File - Fatal编程技术网

File 如何选择名称上有日期的所有文件?

File 如何选择名称上有日期的所有文件?,file,date,batch-file,File,Date,Batch File,我有多个文件,如qulogscan_141201.txt(年-月-日) 我正在尝试创建一个批处理,该批处理将拾取该文件并在其中找到“notloaded”,到目前为止,我所做的是: Echo NOTLOADED Echo\ set yy=%date:~-2% set mm=%date:~-7,2% set dd=%date:~-10,2% setlocal EnableDelayedExpansion rem Assemble the list of line numbers set numbe

我有多个文件,如qulogscan_141201.txt(年-月-日) 我正在尝试创建一个批处理,该批处理将拾取该文件并在其中找到“notloaded”,到目前为止,我所做的是:

Echo NOTLOADED
Echo\
set yy=%date:~-2%
set mm=%date:~-7,2%
set dd=%date:~-10,2%

setlocal EnableDelayedExpansion
rem Assemble the list of line numbers
set numbers=
set "folder=J:\Console\Output_Del\sscmex\qulogscan_%yy%%mm%%dd%.txt"
for /F "delims=:" %%a in ('findstr /I /N /C:"NOTLOADED" "%folder%"') do (
   set /A after=%%a+3
   set "numbers=!numbers!!after!: "
)
rem Search for the lines
(for /F "tokens=1* delims=:" %%a in ('findstr /N "^" "%folder%" ^| findstr /B "%numbers%"') do echo %%b)

如何让它选择文件qulogscan.txt,忽略数据戳而不重命名它?

您是否尝试过
dir/b qulogscan.*
作为
FOR
循环的输入?我将在哪里插入该行?