You might find this Function useful (created in 5 minutes) >> It searches a specific filetype e.g. .au3 with a particular keyword. So in the Example below I've set recursion to True and I'm looking for DropIt in .au3 files located in the @ScriptDir. Multiple filetypes aren't supported, but it's easy to add.
Hint: StringSplit() using ';' e.g. *.au3;*.txt
Code:
#include <Array.au3>
Global $aArray
$aArray = _FindInFile("DropIt", @ScriptDir, "*.au3") ; by guinness 2011
_ArrayDisplay($aArray)
Func _FindInFile($sSearch, $sFolder, $sMask = "*", $iRecursive = 1, $iCaseSensitive = 0, $iDetail = 0)
Local $iPID, $sCaseSensitive = "/i", $sCommand, $sDetail = "/m", $sRecursive = "", $sStdOut_Read = ""
If $iCaseSensitive Then
$sCaseSensitive = ""
EndIf
If $iDetail Then
$sDetail = "/n"
EndIf
If $iRecursive Then
$sRecursive = "/s"
EndIf
$sFolder = StringRegExpReplace($sFolder, "[\\/]+\z", "") & "\"
$sCommand = 'findstr ' & $sCaseSensitive & ' ' & $sDetail & ' ' & $sRecursive & ' "' & $sSearch & '" "' & $sFolder & $sMask & '"'
ConsoleWrite($sCommand & @CRLF)
$iPID = Run(@ComSpec & ' /c ' & $sCommand, @SystemDir, @SW_HIDE, 4 + 2)
$sStdOut_Read = ""
While ProcessExists($iPID)
$sStdOut_Read &= StdoutRead($iPID)
WEnd
Return StringSplit(StringTrimRight(StringStripCR($sStdOut_Read), 1), @LF)
EndFunc ;==>_FindInFile