[英]Batch script to read specific word from a text file and write to another file
I need some help on a batch script which has to achieve the following : 我需要批处理脚本的一些帮助,该脚本必须实现以下目的:
Thanks in advance to anyone who can give me a hand. 在此先感谢任何可以帮助我的人。
I guess, it would be something like this: 我猜可能是这样的:
@echo off @回声关闭
Set DirToSearch="D:\MyFolders\"
Set LineToRead="This is my line"
pushd %DirToSearch%
for /r %%f in (*.txt) do (
For /F %%l in ('Findstr /L /I %LineToRead% "%%f"') do (
if %%l equ " " (
echo File:"%%f" is Not OK >> D:\FileStatus.txt
) else (
echo Line: %%l
echo File:"%%f" is OK >> D:\FileStatus.txt
)
)
)
Goto :End
:End
popd
Hope it helps. 希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.