Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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
Batch file 在控制台上显示文本文件中的特定行-批处理文件_Batch File - Fatal编程技术网

Batch file 在控制台上显示文本文件中的特定行-批处理文件

Batch file 在控制台上显示文本文件中的特定行-批处理文件,batch-file,Batch File,好的,我有一个文本文档显示各种日志。其中一个日志的示例如下所示: Session Begin: 11/04/2013 - 1:36:52.87 10002,CREATE,100 LIST 10002,DEPOSIT,100 10002,DEPOSIT,250 10002,DEPOSIT,150 Session END: 11/04/2013 - 1:37:23.95 我试图完成的是在控制台上显示所有包含“10002”的行。有更多的数字(或者在我的情况下是帐号),它们都设置为变量

好的,我有一个文本文档显示各种日志。其中一个日志的示例如下所示:

Session Begin: 11/04/2013 -  1:36:52.87 
10002,CREATE,100 
LIST 
10002,DEPOSIT,100 
10002,DEPOSIT,250 
10002,DEPOSIT,150 
Session END: 11/04/2013 -  1:37:23.95
我试图完成的是在控制台上显示所有包含“10002”的行。有更多的数字(或者在我的情况下是帐号),它们都设置为变量%AccNum%。简单性在这里也会有帮助,谢谢

find "10002" yourlogfile.txt

这可能是最简单的方法。

天哪,我一定是想太多了,非常感谢!)