I made a script for this in Simba, but I only designed it to search through folders and sub-folders (not sub-sub folders and so on)
Here:
Simba Code:
// Made by Zyt3x
const
DEBUG = FALSE;
DIR = IncludePath + 'SRL\SRL\';
SearchStr = 'Pos(''k''';
EXT = 'scar'; // Extension. (CompileSRL.scar, Setup.simba)
var
Directories, S, S2, Files, AllFiles : TStringArray;
H, Hi, I, Int, F : Integer;
begin
ClearDebug;
Directories := GetDirectories(DIR);
H := High(Directories);
SetArrayLength(Directories, H+2);
WriteLn(DIR);
for I := 0 to H+1 do
begin
if Length(Directories[I]) <> 0 then
if Directories[I][Length(Directories[I])] <> '\' then Directories[I] := Directories[I] + '\';
if DEBUG then
WriteLn(DIR + Directories[I]);
Files := GetFiles(DIR + Directories[I], EXT);
Hi := High(Files);
for Int := 0 to Hi do
begin
if DEBUG then
WriteLn(' - ' + DIR + Directories[I] + Files[Int]);
if FileExists(DIR + Directories[I] + Files[Int]) then
begin
F := OpenFile(DIR + Directories[I] + Files[Int], False);
SetArrayLength(S, Length(S)+1);
SetArrayLength(AllFiles, Length(AllFiles)+1);
ReadFileString(F, S[High(S)], FileSize(F));
AllFiles[High(AllFiles)] := DIR + Directories[I] + Files[Int];
CloseFile(F);
end;
end;
end;
H := High(S);
WriteLn('');
WriteLn(SearchStr + ' found in:');
for I := 0 to H do
begin
if Pos(LowerCase(SearchStr), LowerCase(S[I])) <> 0 then
WriteLn(' + ' + AllFiles[I]);
end;
end.