[英]How to read a text file and write it word by word into another file in python?
[英]Batch script to read specific word from a text file and write to another file
我需要批处理脚本的一些帮助,该脚本必须实现以下目的:
在此先感谢任何可以帮助我的人。
我猜可能是这样的:
@回声关闭
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
希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.