The three fields of the subtable correspond to the 2nd, 6th, and 7th fields of the general table, respectively.
The main question is how to improve the efficiency of search? Based on the sample data on my computer, it takes about 5 seconds to filter through the traversal loop. When the data increases, the filtering time also increases exponentially. Is there a more efficient way to deal with it?
The number of filtered rows is 1027 rows.
data:
Code: Select all
T_start:=A_TickCount
fulllist:=A_ScriptDir "\fulllist.csv"
sublist:=A_ScriptDir "\sublist.csv"
SplitPath, fulllist, name, dir, ext, name_no_ext, Drive
Outputfile:=dir "\out.csv"
FileDelete,%outputfile%
FileRead,fulllist0,%fulllist%
ofulllist:=StrSplit(fulllist0,"`n")
out:=""
loop, Read, %sublist%
{
Array6:= StrSplit(A_LoopReadLine,"`,")
for index, element in ofulllist
{
if (InStr(ofulllist[A_Index],Array6[1]) && InStr(ofulllist[A_Index],Array6[2]) && InStr(ofulllist[A_Index],Array6[3]) )
out.= ofulllist[A_Index] "`n"
}
}
FileAppend, %out%,%Outputfile%,utf-8
MsgBox, % A_TickCount-T_start "ms" ;7326ms
ExitApp