I have file called Test.txt contains
Introduction
License
Installation Directory
Frequently Asked Questions (FAQ)
Credits
History ChangeLog
History of and Developers
Running Scripts
Script Editors
Compiling Scripts
Window Info Tool (Info)
Window Titles and Text (Basic)
Window Titles and Text (Advanced)
Controls
Running under normal user
I wanted get multiple string "License", "Script Editors", "Controls","Window Info Tool (AU3Info)" as print ouput with searched lines using autoit
below code I can search only one time
#include <File.au3>
#include <array.au3>
$file = @ScriptDir & "\file.txt"
$search = "word"
If FileExists($file) Then
$contents = FileRead($file)
If @error Then
MsgBox(0, 'File Error', $file & ' could not be read.')
Else
For $i = 1 To $count
If StringInStr($contents, $search) Then
MsgBox(0, 'found', $file & ' does contain the text "' & $search & '"')
Else
MsgBox(0, 'Not', $file & ' does NOT contain the text "' & $search & '"')
EndIf
Next
EndIf
EndIf
$count
without$count
being initialized, you will end up with nothing... as it results to0
, so the loop won't even run once... – Johannes Thomas Meyer 22 hours ago#include <array.au3>
is completely unnecassary. – Johannes Thomas Meyer 22 hours ago