![]() Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Locate a Word in a Text File and Then Echo Back That Word and Any Remaining Text
|
||
Const ForReading = 1
Set obJFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:\Scripts\Test.txt", ForReading) strContents = objFile.ReadAll objFile.Close arrWords = Split(strContents, " ") intStart = 0 For Each strWord in arrWords If InStr(strWord, "telescope") Then intStart = intStart + 1 End If If intStart > 0 Then strFinalText = strFinalText & strWord & " " End If Next Wscript.Echo strFinalText | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |