[ autoit ]
#include <Excel.au3> $Log= @ScriptDir & "\log.xlsx" ; containing 620 (sometimes more, sometimes less) ip entries from A2 to A621 $oExcel_log= _ExcelBookOpen($Log, 0) ; open excel file as not visible $aArray_log = _ExcelReadSheetToArray($oExcel_log, 1, 1, 0, 1) ; create a 2D array from the A column $Max_log = $aArray_log[0][0] ; read how many rows are in column A MsgBox(16, "Max_log", $Max_log) ; info msg with number of rows $Geo= @ScriptDir & "\geo.xlsx" ; containing 178546 entries in from of A2 = 16777216, B2 = 16777471, C2 = Australia, for more info visit http://dev.maxmind.com/geoip/geolite $oExcel_geo = _ExcelBookOpen($Geo, 0) ; open excel file as not visible $aArray_geo = _ExcelReadSheetToArray($oExcel_geo, 1, 1, 0, 3) ; create a 2D array from the A, B, C columns $Max_geo = $aArray_geo[0][0] ; read how many rows are in column A MsgBox(16, "Max_geo", $Max_geo) ; info msg with number of rows Local $begin = TimerInit() ; start of calculating time difference in milliseconds. Local $i_log = 2 ; log.xlsx reading start ponit Do ; loop $IP = $aArray_log[$i_log][1] ; taking IP from log.xlsx $temp = StringSplit($IP,'.') ; splits up a string into substrings $decIP = ($temp[1]*256*256*256)+($temp[2]*256*256)+($temp[3]*256)+$temp[4] ; converting IP to decimal value, more info https://www.ultratools.com/tools/decimalCalc For $i_geo = 2 To $Max_geo ; geo.xlsx reading start ponit, Loop If $decIP >= $aArray_geo[$i_geo][1] And $decIP <= $aArray_geo[$i_geo][2] Then $dummy = 1 ; commparing decimal IP with values from geo.xlsx and define walue just to script go on Next $i_log = $i_log + 1 Until $i_log = $Max_log ; Do until read all rows in log.xlsx Local $dif = TimerDiff($begin) ; end of calculating time difference in milliseconds. MsgBox(0, "Time Difference", $dif) ; 142 sec <<<<<<< TO SLOW!!! ; closing excel files _ExcelBookClose($oExcel_log, 0, 0) $oExcel_log.Application.Quit _ExcelBookClose($oExcel_geo, 0, 0) $oExcel_geo.Application.Quit Exit