1
我嘗試製作一個VBScript,它讀取一個txt並搜索兩個字符串,並僅給出最後結果。VBScript在TXT中搜索兩個字符串
串1:Hello123
字符串2:Test123
的TXT看起來是這樣的:
27.07.2010 09:45 ... DumDumDum ...
27.07.2010 09:45 ... BlaBlaBla ...
27.07.2010 09:45 ... Hello123 ...
27.07.2010 09:45 ... BlaBlaBla ...
27.07.2010 09:45 ... DumDumDum ...
27.07.2010 09:45 ... DumDumDum ...
27.07.2010 09:45 ... Hello123 ... 'This Result
27.07.2010 09:45 ... BlaBlaBla ...
27.07.2010 09:45 ... BlaBlaBla ...
27.07.2010 09:45 ... DumDumDum ...
27.07.2010 09:45 ... Test123 ...
27.07.2010 09:45 ... DumDumDum ...
27.07.2010 09:45 ... Test123 ... 'And this Result
27.07.2010 09:45 ... DumDumDum ...
27.07.2010 09:45 ... BlaBlaBla ...
我嘗試這樣的事情,但我不知道如何做到這一點:
閱讀與ReadALL txt思考而不是搜索部分。
if string 1 not found then
msgbox "nothing found"
Goto NEXT
else
if string 2 not found then
msgbox "nothing found"
else
msgbox "found"
End if
End if
NEXT
有人有一個想法,可以幫助我嗎?
問候, 馬蒂亞斯
感謝這一點,但我一定要有計劃在VBScript :-),因爲它只是其中的一部分,從一個大的腳本 – Sebastian 2010-07-27 08:11:04
你能告訴我這個有腳本? – Sebastian 2010-07-27 09:01:15
好的謝謝你的例子,但我的問題是我如何搜索最後建立的字符串1後的第二個字符串?比我高興:-D – Sebastian 2010-07-27 09:25:46