Sign in to follow this  
Followers 0
guinness

GeoIP database parsing examples.

8 posts in this topic

#1 ·  Posted (edited)

Here are a couple of examples to find the geographical location of an IP address using various databases located around the Internet.

IpToCountry.csv:

#include <Array.au3>
#include <Constants.au3>

#cs
    Initial discussion: http://www.autoitscript.com/forum/topic/147550-sre-guru-challenge/
#ce

Example()

Func Example()
    Local $sIP = '74.125.224.72' ; 'Google IP'
    Local $sString = _IPv4ToInt($sIP)

    Local $sRead = FileRead(@ScriptDir & '\IpToCountry.csv') ; http://software77.net/geo-ip/
    Local $hTimer = TimerInit()
    Local $aArray = StringRegExp($sRead, '"(' & StringLeft($sString, 2) & '\d{6,8})","(\d{8,10})","([a-z]+)","(\d{8,10})","([A-Z]{2})","([A-Z]{2,3})","([a-zA-Z ]+)"\n', 3)
    If @error = 0 Then
        Local $aReturn[7]
        For $i = 0 To UBound($aArray) - 1 Step 7
            If $sString >= $aArray[$i] And $sString <= $aArray[$i + 1] Then
                $aReturn[0] = $aArray[$i]
                $aReturn[1] = $aArray[$i + 1]
                $aReturn[2] = $aArray[$i + 2]
                $aReturn[3] = $aArray[$i + 3]
                $aReturn[4] = $aArray[$i + 4]
                $aReturn[5] = $aArray[$i + 5]
                $aReturn[6] = $aArray[$i + 6]
                ExitLoop
            EndIf
        Next
        ConsoleWrite(TimerDiff($hTimer) & @CRLF)
        _ArrayDisplay($aReturn)
    Else
        MsgBox($MB_SYSTEMMODAL, '', 'Well an error occurred. Sorry.')
    EndIf
EndFunc   ;==>Example

Func _IPv4ToInt($sString) ; By JohnOne
    Local $aStringSplit = StringSplit($sString, '.', 3)
    Local $iOct1 = Int($aStringSplit[0]) * (256 ^ 3)
    Local $iOct2 = Int($aStringSplit[1]) * (256 ^ 2)
    Local $iOct3 = Int($aStringSplit[2]) * (256)
    Local $iOct4 = Int($aStringSplit[3])
    Return $iOct1 + $iOct2 + $iOct3 + $iOct4
EndFunc   ;==>_IPv4ToInt
Edited by guinness
2 people like this

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

ipligence-lite.csv:

#include <Array.au3>
#include <Constants.au3>

#cs
    Initial discussion: http://www.autoitscript.com/forum/topic/147550-sre-guru-challenge/
#ce

Example()

Func Example()
    Local $sIP = '74.125.224.72' ; 'Google IP'
    Local $sString = _IPv4ToInt($sIP)

    Local $sRead = FileRead(@ScriptDir & '\ipligence-lite.csv') ; http://www.ipligence.com/free-ip-database
    Local $hTimer = TimerInit()
    Local $aArray = StringRegExp($sRead, '"(' & StringLeft($sString, 2) & '\d{8})","(\d{10})","([A-Z]{0,4})?","([A-Z ]*)?","([A-Z]{0,4})?","([A-Z ]*)?"\r\n', 3)
    If @error = 0 Then
        Local $aReturn[6]
        For $i = 0 To UBound($aArray) - 1 Step 6
            If $sString >= $aArray[$i] And $sString <= $aArray[$i + 1] Then
                $aReturn[0] = $aArray[$i]
                $aReturn[1] = $aArray[$i + 1]
                $aReturn[2] = $aArray[$i + 2]
                $aReturn[3] = $aArray[$i + 3]
                $aReturn[4] = $aArray[$i + 4]
                $aReturn[5] = $aArray[$i + 5]
                ExitLoop
            EndIf
        Next
        ConsoleWrite(TimerDiff($hTimer) & @CRLF)
        _ArrayDisplay($aReturn)
    Else
        MsgBox($MB_SYSTEMMODAL, '', 'Well an error occurred. Sorry.')
    EndIf
EndFunc   ;==>Example

Func _IPv4ToInt($sString) ; By JohnOne
    Local $aStringSplit = StringSplit($sString, '.', 3)
    Local $iOct1 = Int($aStringSplit[0]) * (256 ^ 3)
    Local $iOct2 = Int($aStringSplit[1]) * (256 ^ 2)
    Local $iOct3 = Int($aStringSplit[2]) * (256)
    Local $iOct4 = Int($aStringSplit[3])
    Return $iOct1 + $iOct2 + $iOct3 + $iOct4
EndFunc   ;==>_IPv4ToInt
Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

GeoIPCountryWhois.csv:

#include <Array.au3>
#include <Constants.au3>

#cs
    Initial discussion: http://www.autoitscript.com/forum/topic/147550-sre-guru-challenge/
#ce

Example()

Func Example()
    Local $sIP = '74.125.224.72' ; 'Google IP'
    Local $sString = _IPv4ToInt($sIP)

    Local $sRead = FileRead(@ScriptDir & '\GeoIPCountryWhois.csv') ; http://dev.maxmind.com/geoip/geolite
    Local $hTimer = TimerInit()
    Local $aArray = StringRegExp($sRead, '"([\d.]{7,15})","([\d.]{7,15})","(' & StringLeft($sString, 2) & '\d{5,8})","(\d{7,10})","([A-Z]{2})","([a-zA-Z ]+)"\n', 3)
    If @error = 0 Then
        Local $aReturn[6]
        For $i = 0 To UBound($aArray) - 1 Step 6
            If $sString >= $aArray[$i + 2] And $sString <= $aArray[$i + 3] Then
                $aReturn[0] = $aArray[$i]
                $aReturn[1] = $aArray[$i + 1]
                $aReturn[2] = $aArray[$i + 2]
                $aReturn[3] = $aArray[$i + 3]
                $aReturn[4] = $aArray[$i + 4]
                $aReturn[5] = $aArray[$i + 5]
                ExitLoop
            EndIf
        Next
        ConsoleWrite(TimerDiff($hTimer) & @CRLF)
        _ArrayDisplay($aReturn)
    Else
        MsgBox($MB_SYSTEMMODAL, '', 'Well an error occurred. Sorry.')
    EndIf
EndFunc   ;==>Example

Func _IPv4ToInt($sString) ; By JohnOne
    Local $aStringSplit = StringSplit($sString, '.', 3)
    Local $iOct1 = Int($aStringSplit[0]) * (256 ^ 3)
    Local $iOct2 = Int($aStringSplit[1]) * (256 ^ 2)
    Local $iOct3 = Int($aStringSplit[2]) * (256)
    Local $iOct4 = Int($aStringSplit[3])
    Return $iOct1 + $iOct2 + $iOct3 + $iOct4
EndFunc   ;==>_IPv4ToInt
Edited by guinness
1 person likes this

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

@Guiness

Maybe something to add.

#Include <APIConstants.au3>
#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $ID = _WinAPI_GetUserGeoID()

ConsoleWrite('ID:    0x' & Hex($ID) & @CR)
ConsoleWrite('Latitude: ' & _WinAPI_GetGeoInfo($ID, $GEO_LATITUDE) & @CR)
ConsoleWrite('Longitude: ' & _WinAPI_GetGeoInfo($ID, $GEO_LONGITUDE) & @CR)
ConsoleWrite('Name:  ' & _WinAPI_GetGeoInfo($ID, $GEO_FRIENDLYNAME) & @CR)
ConsoleWrite('ISO code: ' & _WinAPI_GetGeoInfo($ID, $GEO_ISO3) & @CR)
ConsoleWrite (' '& @CR)

Global $sLat = _WinAPI_GetGeoInfo($ID, $GEO_LATITUDE)
Global $sLong = _WinAPI_GetGeoInfo($ID, $GEO_LONGITUDE)

; [url="https://developers.google.com/maps/documentation/geocoding/"]https://developers.google.com/maps/documentation/geocoding/[/url]
#include <Inet.au3>
ConsoleWrite(_INetGetSource('http://maps.googleapis.com/maps/api/geocode/xml?latlng='& $sLat & ',' & $sLong&'&sensor=false') & @CR)

Enjoy !

Share this post


Link to post
Share on other sites

Thanks.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

On my system IpToCountry.csv came out as being the quickest to parse. I wonder what other users experience on their system?


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

On my system IpToCountry.csv came out as being the quickest to parse. I wonder what other users experience on their system?

I have been using this ever since you posted it and I was following it from the time you made that post in general help and support, thanks for the code!

I thought I'd log the time it would take, it averages out to 300ms on my Intel Duel CPU E2200.

>Completed: 291.47494072515

>Completed: 308.126821648562

>Completed: 352.296010269653

>Completed: 303.514228291255

>Completed: 263.903641016428

>Completed: 251.597651533699

>Completed: 261.601067924743

>Completed: 264.205251560881

>Completed: 260.454203138425

>Completed: 281.5166728261

>Completed: 257.627535180915

>Completed: 251.433348258711

>Completed: 272.58471858526

>Completed: 332.326878805622

>Completed: 243.649655149302

>Completed: 378.184248668585

>Completed: 334.384160605753

>Completed: 334.39160777969

>Completed: 353.487558099593

>Completed: 341.476662884123

>Completed: 356.920239836237

>Completed: 345.763907830052

>Completed: 359.835808432621

>Completed: 364.722085432118

>Completed: 357.406167935634

>Completed: 345.607517177372

>Completed: 483.849872420602

>Completed: 378.138169279849

>Completed: 340.854358412002

>Completed: 379.163552041317

>Completed: 397.857354968615

>Completed: 348.940127514236

>Completed: 452.383235294391

>Completed: 348.794442174091

>Completed: 360.951953626448

>Completed: 341.081031768713

>Completed: 359.360120197387

>Completed: 344.325206915073

>Completed: 355.538323622529

>Completed: 367.066548877199

>Completed: 339.028404452293

>Completed: 344.619835733961

>Completed: 387.99683122749

>Completed: 377.834696941911

>Completed: 348.591506684304

>Completed: 352.582261017861

>Completed: 348.613848206115

>Completed: 361.579378030651

>Completed: 434.808835699518

>Completed: 434.373641472567

>Completed: 351.42934540272

>Completed: 349.301315450186

>Completed: 370.12407922676

>Completed: 381.662078897223

>Completed: 364.092799234431

>Completed: 349.175644389997

>Completed: 344.205586683708

>Completed: 350.45516196207

>Completed: 348.874964742286

>Completed: 392.054610126481

>Completed: 366.766334677859

>Completed: 347.946860690372

>Completed: 350.923868471738

>Completed: 455.180114556153

>Completed: 365.125629169836

>Completed: 360.744829101322

>Completed: 356.626541914091

>Completed: 381.396773325712

>Completed: 380.868489424548

>Completed: 354.33420868657

>Completed: 359.240034517651

>Completed: 351.842198107859

>Completed: 344.552345720156

>Completed: 338.516876692487

>Completed: 368.394007631491

>Completed: 360.933801139976

>Completed: 358.320773984787

>Completed: 352.482189618081

>Completed: 338.319061134782

>Completed: 346.733436786991

>Completed: 434.582162342807

>Completed: 343.691266233676

>Completed: 348.758602649518

>Completed: 360.306842184144

>Completed: 347.866338122177

>Completed: 280.426592741053

>Completed: 339.884364006691

>Completed: 371.191352341624

>Completed: 358.474371947241

>Completed: 348.865655774864

>Completed: 343.548373583757

>Completed: 342.747802385516

>Completed: 369.835501236696

>Completed: 393.016226461112

>Completed: 345.727137408737

>Completed: 343.818333638978

>Completed: 373.267252076598

>Completed: 347.515390050389

>Completed: 349.274784893035

>Completed: 337.890383185026

>Completed: 383.632787300334

>Completed: 349.545210396627

>Completed: 346.016180847172

>Completed: 346.373179747783

>Completed: 342.327037058068

>Completed: 369.832243098099

>Completed: 369.304424645305

>Completed: 343.143433500926

>Completed: 346.642208906261

>Completed: 368.281369125692

>Completed: 372.387554655275

>Completed: 354.780108226055

>Completed: 392.005738047519

>Completed: 351.552223772682

>Completed: 342.344258647798

>Completed: 346.040849610839

>Completed: 414.015860618693

>Completed: 334.196119463841

>Completed: 358.432016145473

>Completed: 371.273736703304

>Completed: 342.127359706879

>Completed: 363.537984776115

>Completed: 347.308265525263

>Completed: 379.497743971745

>Completed: 343.487399847147

>Completed: 347.917537442994

>Completed: 355.758015253674

>Completed: 366.056991360347

>Completed: 355.836210580014

>Completed: 348.488177145926

>Completed: 359.451348078117

>Completed: 343.259330145322

>Completed: 361.676656740204

>Completed: 2018.15900274894

>Completed: 339.201551246331

>Completed: 364.390686191916

>Completed: 339.53574317676

>Completed: 355.477349885919

>Completed: 335.525905459989

>Completed: 358.407347381806

>Completed: 344.478339429156

>Completed: 420.683873982646

>Completed: 361.254495067644

>Completed: 361.483030217839

>Completed: 353.132420992466

>Completed: 372.599799112483

>Completed: 363.136768280252

>Completed: 363.959215551933

>Completed: 349.042991604242

>Completed: 343.959829943783

>Completed: 363.138630073736

>Completed: 338.890631734456

>Completed: 383.643027164498

>Completed: 356.936065080853

>Completed: 381.08259567524

>Completed: 350.154947762729

>Completed: 356.777812634689

>Completed: 364.971565759011

>Completed: 349.861715288955

>Completed: 380.394197534427

>Completed: 358.790411391197

>Completed: 378.036236086585

>Completed: 347.121620728464

>Completed: 275.747905715054

>Completed: 333.808400970739

>Completed: 389.563995892884

>Completed: 341.741037558891

>Completed: 369.505032893236

>Completed: 345.957534352417

>Completed: 354.216450248689

>Completed: 391.039467229177

>Completed: 423.104205512212

>Completed: 386.723829932612

>Completed: 345.363622230931

>Completed: 365.948541889888

>Completed: 368.074244600566

>Completed: 368.158956204101

>Completed: 351.35999359543

>Completed: 361.129289455826

>Completed: 349.334827732903

>Completed: 344.0673485175

>Completed: 339.760554739987

>Completed: 345.188148195038

>Completed: 473.74312649118

>Completed: 369.057737008638

>Completed: 360.734123788787

>Completed: 392.829116215942

>Completed: 402.435039698092

>Completed: 355.425219668359

>Completed: 373.427366316246

>Completed: 364.541956912513

>Completed: 345.051771822314

>Completed: 370.421035287503

>Completed: 366.473102204084

>Completed: 358.054072068164

>Completed: 376.322920632675

>Completed: 355.004454340911

>Completed: 374.904699446023

>Completed: 344.588185244728

>Completed: 338.807781924406

>Completed: 360.508846777189

>Completed: 371.415233008109

>Completed: 342.074298592577

>Completed: 349.443277203363

>Completed: 374.447629145632

>Completed: 285.458555080695

>Completed: 385.995868680258

>Completed: 343.231868691429

>Completed: 370.781292326711

>Completed: 364.638304725325

>Completed: 370.442911360943

>Completed: 347.569847509805

>Completed: 375.021061538791

>Completed: 343.580954969732

>Completed: 373.341258367598

>Completed: 364.228710158783

>Completed: 356.574411696531

>Completed: 371.452934326166

>Completed: 262.101424923643

>Completed: 362.480020628672

>Completed: 361.24006616814

>Completed: 360.835126085309

>Completed: 342.260012492634

>Completed: 360.823489876033

>Completed: 344.234909931086

>Completed: 351.791929683784

>Completed: 368.341411965561

>Completed: 366.882696770626

>Completed: 365.676254592812

>Completed: 280.002569275008

>Completed: 338.278101678128

>Completed: 355.131056297842

>Completed: 375.385042164968

>Completed: 453.857775733942

>Completed: 355.252072874321

>Completed: 453.155879590368

>Completed: 356.013080961021

>Completed: 358.041970410516

>Completed: 480.910100508921

>Completed: 356.745696697085

>Completed: 406.248458202271

>Completed: 366.023013629259

>Completed: 341.68844189296

>Completed: 386.685663166185

>Completed: 369.310010025758

>Completed: 367.840589518289

>Completed: 359.564917480658

>Completed: 371.801555156097

>Completed: 394.817046208783

>Completed: 334.123509517954

>Completed: 357.540217066502

>Completed: 258.858646122396

>Completed: 377.606627240087

>Completed: 352.982546616982

>Completed: 373.623785528838

>Completed: 455.066079705241

>Completed: 333.529597396468

>Completed: 343.448302183977

>Completed: 369.099627362034

>Completed: 340.53599172619

>Completed: 393.508205389334

>Completed: 335.153081314761

>Completed: 337.53105704256

>Completed: 337.936462573762

>Completed: 377.926855719383

>Completed: 339.310000716791

>Completed: 358.635882532002

>Completed: 357.008209578369

>Completed: 344.095275419765

>Completed: 354.215984800318

>Completed: 360.930543001379

>Completed: 352.466829821836

>Completed: 371.869976066645

>Completed: 339.900189251308

>Completed: 331.77811517613

>Completed: 363.739989369159

>Completed: 338.480571719543

>Completed: 335.129808896208

>Completed: 346.157677151977

>Completed: 371.28537291258

>Completed: 350.268051716899

>Completed: 344.168816262394

>Completed: 342.20602048159

>Completed: 367.911337670692

>Completed: 438.095366647645

>Completed: 342.431762941559

>Completed: 356.560448245399

>Completed: 354.196901417104

>Completed: 364.912453815885

>Completed: 366.728167911431

>Completed: 335.028341151314

>Completed: 373.212794617183

>Completed: 379.010419527235

>Completed: 358.420379936196

>Completed: 390.430660759817

>Completed: 360.936128381832

>Completed: 289.991091318178

>Completed: 354.583689013464

>Completed: 356.873229550759

>Completed: 336.368832459997

>Completed: 336.446096889595

Share this post


Link to post
Share on other sites

Thanks. I'm glad I can be of some use once in a while.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0