I wrote a script to filter out crawler-bot IPs from a list of referrer URLs in a text file. After that a listview is filled with this array. I thougt deleting a line in an array deletes the key/value pair but only the value is deleted. So the listview is filled with empty lines between. How could I get rid of this? And, I bet there are much better aproaches of filtering then I did, maybe someone could point me the way to another method.
Refers is a .txt with a referrer url in each line
IpList is a .txt with a bot IP in each line
Code: Select all
RefArray := Object()
Loop, Read, %Refers%
{
RefArray.Insert(A_LoopReadLine)
}
Loop, % RefArray.Length()
{
element := RefArray[A_Index]
MyIndex := A_Index
Loop, Read, %IpList%
{
IfInString, element, %A_LoopReadLine%
RefArray.Delete(MyIndex)
}
}
Loop % RefArray.Length()
{
line := RefArray[A_Index]
LV_Add(, line)
}
LV_ModifyCol()
IRBaboon