![](/img/trans.png)
[英]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.