
stamandster
Active Members-
Posts
86 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
stamandster's Achievements

Wayfarer (2/7)
5
Reputation
-
AD UDF - Object Attributes for Groups?
stamandster replied to stamandster's topic in AutoIt General Help and Support
@water No I'm not expecting anything to be the same. I'm just simply looking to query a specific attribute in another domain in the forest for a group I specify. Just the same as I can lookup an attribute in my current domain for a group. -
AD UDF - Object Attributes for Groups?
stamandster replied to stamandster's topic in AutoIt General Help and Support
Thanks @water That seemed to work for the domain my own account is authenticated to. When I use _AD_Open and choose another domain in the forest, and a server to query, it isn't pulling the same information. Any tips? -
AD UDF - Object Attributes for Groups?
stamandster replied to stamandster's topic in AutoIt General Help and Support
@water Sorry about that! I'm attempting to use _AD_GetObjectAttribute(<SecurityGroup>,"objectSid") and it's not pulling the info (using sAMAccountName). Doesn't seem to work either when using FQDN (for me at least). -
AD UDF - Object Attributes for Groups?
stamandster posted a topic in AutoIt General Help and Support
Hi All, Trying to pull the objectSid from a security group and getting nothing, no matter what I try. Is this even possible with the AD UDF? Normal accounts seem to work fine. Any suggestions would be appreciated. -
Simple tool to run in the user context to notify them that they are locked out of the network. The notification window will go away once the user is locked out. The notification window is transparent and click-through able. Will work even if logged into multiple workstations. #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=135853869.ico #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <array.au3> #include <string.au3> #include <Array.au3> #include <WinAPIShPath.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> GLOBAL $NotificationTitle = "IT WARNING!" GLOBAL $tR = 0 GLOBAL $hC, $hP GLOBAL $fRun = 0 GLOBAL $wbemFlagReturnImmediately = 0x10 GLOBAL $wbemFlagForwardOnly = 0x20 GLOBAL $strComputer = "localhost" GLOBAL $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") While 1 sleep(30000) $LockOutStatus = _Query_WMI_Lockout_Status() Select Case Stringinstr($LockOutStatus,"False") consolewrite($LockOutStatus &" -_- "& $tR & @CRLF) GLOBAL $tR = 0 _NotificationPrompt(false) Case Stringinstr($LockOutStatus,"True") AND $tR = 0 consolewrite($LockOutStatus &" -_- "& $tR & @CRLF) GLOBAL $tR = 1 _NotificationPrompt(true) Case Else consolewrite("Still " & $LockOutStatus &" -_- "& $tR & @CRLF) EndSelect WEnd Func _Query_WMI_Lockout_Status() $colItems = "" $colItems = $objWMIService.ExecQuery("SELECT Lockout FROM Win32_UserAccount where Name = '"& @username &"'", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then Local $Object_Flag = 0 For $objItem In $colItems if @username = $objItem.Name Then Return $objItem.Lockout EndIf Next EndIf EndFunc func _NotificationPrompt($npState = true) Select Case $npState = true $Prompt = "You have been locked out of your Domain Account (computer logon)." & @CRLF _ & "Please contact the Helpdesk at extension 1234 to be unlocked." $WindowTitle = "LockedNotificationWindow" $hP = GUICreate('',0,0,0,0,0,$WS_EX_TOOLWINDOW) GLOBAL $hC = GUICreate($WindowTitle,305,105,@Desktopwidth-315,@DesktopHeight-1,$WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TRANSPARENT),$hP) ;GLOBAL $hC = GUICreate($WindowTitle,305,105,@Desktopwidth-315,@DesktopHeight-1,$WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TRANSPARENT),$hP) GUISetBkColor(0x3C3C3C) GUICtrlCreateLabel($NotificationTitle,8,8,290,100) GuiCtrlSetColor(-1,0xFFFFFF) GuiCtrlSetFont(-1,12,800,0,"Tahoma") GUICtrlCreateLabel($Prompt,8,32,290,100) GuiCtrlSetColor(-1,0xFFFFFF) GuiCtrlSetFont(-1,10,400,0,"Tahoma") GUISetState(@SW_SHOW) WinSetTrans($WindowTitle,"",135) WinActivate($WindowTitle) ;$aPos = WinGetPos($WindowTitle) WinMove($hC,'',@Desktopwidth-315,@DesktopHeight-155,305,105,2) Case $npState = false WinMove($hC,'',@Desktopwidth-315,@DesktopHeight,305,105,2) IF $hC <> "" Then GUIDelete($hC) IF $hP <> "" Then GUIDelete($hP) EndSelect EndFunc
-
czardas reacted to a post in a topic: Directory Enquiries Challenge
-
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
@iamtheky roger that! 1.5s for how many files? -
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
@iamtheky do you happen to have something already coded for this? ;-) -
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
;-) thank you for choosing us, I think we had similar thought processes. Looking forward to the next challenge! -
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
-
czardas reacted to a post in a topic: Directory Enquiries Challenge
-
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
Must take a long time to make those digital medals ;-) -
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
stamandster reacted to a post in a topic: Directory Enquiries Challenge
-
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
Ok, created a different approach to what I've posted earlier... does away with typos.au3 ;-) #include <Array.au3> GLOBAL $MatchPerc = 30 ; no less than % to match on GLOBAL $MatchLen = 3 ; no smaller than X digits to match on Local $adbPNum = _ ['+262 692 12 03 00', '1800 251 996', '+1 994 951 0197', _ '091 535 98 91 61', '2397865', '08457 128276', _ '348476300192', '05842 361774', '0-800-022-5649', _ '15499514891', '0096 363 0949', '04813137349', _ '06620 220168', '07766 554433', '047 845 44 22 94', _ '0435 773 4859', '(01) 882 8565', '00441619346434', _ '09314 367090', '0 164 268 0887', '0590995603', _ '991', '0267 746 3393', '064157526153', _ '0 719 829 7756', '+1-541-754-3012', '+441347543010', _ '03890 978398', '(31) 10 7765420', '020 8568 6646', _ '0161 934 6534', '0 637 915 1283', '+44 207 882 8565', _ '0800 275002', '0750 646 9746', '982-714-3119', _ '000 300 74 52 40', '023077529227', '1 758 441 0611', _ '0183 233 0151', '02047092863', '+44 20 7946 0321', _ '04935 410618', '048 257 67 60 79'] Local $arPNum = _ ['882 8565', _ '123 8762', _ '7543010', _ '07843 543287', _ '00441619346534', _ '+44208', _ '0015417543012'] Consolewrite('--> Matching Threshold '& $MatchPerc &'% of Reference Number | No less than '& $MatchLen & ' digits' & @CRLF) For $i = 0 to Ubound($arPNum)-1 ; find these numbers! $rPNum = StringRegExpReplace($arPNum[$i],"[^0-9]","") ; Santize Numbers For $a = 0 to ubound($adbPNum)-1 $dbPNum = StringRegExpReplace($adbPNum[$a],"[^0-9]","") ; Sanitize Numbers $pM = _PhoneMatch($rPNum,$dbPNum,$MatchPerc,$MatchLen) IF $pM <> 0 then $sPM = StringSplit($pM,'|') Consolewrite($sPM[1] &'% of Reference Number '& $arPNum[$i] &' matches '& $sPM[2] & '% of DB Phone Number '& $adbPNum[$a] & ' -- Accuracy of ' & $sPM[3] &'%'& @CRLF) EndIf Next Next FUNC _PhoneMatch($_refNum,$_dbNum, $_pMatch = 50, $_refNumLen = 3) LOCAL $_refNumC = $_refNum LOCAL $_dbNumC = $_dbNum LOCAL $C = 0 LOCAL $swap = 0 IF Stringlen($_refNum) > Stringlen($_dbNum) Then $swap = 1 $_refNumC = $_dbNum $_dbNumC = $_refNum EndIf $_refNumR = $_refNumC ; cached Right $_refNumL = $_refNumC ; cached Left Do IF $c <> 0 then $_refNumR = StringTrimRight($_refNumR,1) $_refNumL = StringTrimLeft($_refNumL,1) endif $percDbNum = (StringLen($_refNumR)*(100/StringLen($_dbNumC))) $percRefNum = (StringLen($_refNumR)*(100/StringLen($_refNumC))) Select Case (StringInStr($_dbNumC,$_refNumL) OR StringInStr($_dbNumC,$_refNumR)) and $percDbNum >= $_pMatch if $swap = 1 then $_PMAcc = (StringLeft($percDbNum,5) + StringLeft($percRefNum,5))/2 Return StringLeft($percDbNum,5) &'|'& StringLeft($percRefNum,5) &'|'& StringLeft($_PMAcc,5) else $_PMAcc = (StringLeft($percDbNum,5) + StringLeft($percRefNum,5))/2 Return StringLeft($percRefNum,5) &'|'& StringLeft($percDbNum,5) &'|'& StringLeft($_PMAcc,5) endif EndSelect $c = $c + 1 until StringLen($_refNumL) = $_refNumLen OR StringLen($_refNumR) = $_refNumLen EndFunc Output --> Matching Threshold 30% of Reference Number | No less than 3 digits 100% of Reference Number 882 8565 matches 77.77% of DB Phone Number (01) 882 8565 -- Accuracy of 88.88% 100% of Reference Number 882 8565 matches 58.33% of DB Phone Number +44 207 882 8565 -- Accuracy of 79.16% 85.71% of Reference Number 7543010 matches 54.54% of DB Phone Number +1-541-754-3012 -- Accuracy of 70.12% 100% of Reference Number 7543010 matches 58.33% of DB Phone Number +441347543010 -- Accuracy of 79.16% 78.57% of Reference Number 00441619346534 matches 78.57% of DB Phone Number 00441619346434 -- Accuracy of 78.57% 71.42% of Reference Number 00441619346534 matches 90.90% of DB Phone Number 0161 934 6534 -- Accuracy of 81.16% 80% of Reference Number +44208 matches 33.33% of DB Phone Number +44 207 882 8565 -- Accuracy of 56.66% 80% of Reference Number +44208 matches 33.33% of DB Phone Number +44 20 7946 0321 -- Accuracy of 56.66% 84.61% of Reference Number 0015417543012 matches 100% of DB Phone Number +1-541-754-3012 -- Accuracy of 92.30% -
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
@orbs I like your improvements to the script! ... in regards to the 100% match, the number as a whole doesn't match, but I understand what you mean. 12345 is not the 100% the same as 345 even if 345 exists within 12345. See what I mean? Below is the sample that will sanitize input var to only have numbers $new = StringRegExpReplace($value,"[^0-9]","") -
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
You can use StringRegExpReplace in place of your _StringStripNonNumeric :-) Also, while I think what your doing with the script is awesome :-) Can we really assume that because someone has typed 882 8565 that they also mean to add (01) prefix? The match shows 100% of 882 8565 for both (01) 882 8565 and +44 207 882 8565, which is not completely accurate. What does the percentage indicate? That 100% of the challenge phone number is within the database number? Let's look at 00441619346534, show's 79% similar to 00441619346434. But, I would say that it's 92.86% similar because only one number is different. The math is 100-($nDiff*(100/stringlen($cNum))). $nDiff are the amount of different numbers between the two, $cNum is the challenge number. Though, it get's a little more complicated if the compared numbers lengths vary at all. My own function of checking for accuracy is based on a couple different elements, not the above example. Which is why against the same number I show 99% instead of 92%. +44208 shows a match to +442078828565 @ 80%, which in my mind would be a 66.67% match. The more I play with the information the more I realize that one solution for finding a number does not work for all iterations of numbers and what data you expect to return. Latest code below... factors in partial matches for left to right and right to left of challenge number if under 7 digits long. #include <Array.au3> #include "typos.au3" #cs looking for 882 8565 123 8762 7543010 07843 543287 00441619346534 +44208.....missing numbers [optional task] 44208 0800275002 ; too short, japan local? 08000225649 ; 11 chars 08457128276 ; 11 chars 0015417543012 #ce GLOBAL $refNumT Local $aArray = _ ['+262 692 12 03 00', '1800 251 996', '+1 994 951 0197', _ '091 535 98 91 61', '2397865', '08457 128276', _ '348476300192', '05842 361774', '0-800-022-5649', _ '15499514891', '0096 363 0949', '04813137349', _ '06620 220168', '07766 554433', '047 845 44 22 94', _ '0435 773 4859', '(01) 882 8565', '00441619346434', _ '09314 367090', '0 164 268 0887', '0590995603', _ '991', '0267 746 3393', '064157526153', _ '0 719 829 7756', '+1-541-754-3012', '+441347543010', _ '03890 978398', '(31) 10 7765420', '020 8568 6646', _ '0161 934 6534', '0 637 915 1283', '+44 207 882 8565', _ '0800 275002', '0750 646 9746', '982-714-3119', _ '000 300 74 52 40', '023077529227', '1 758 441 0611', _ '0183 233 0151', '02047092863', '+44 20 7946 0321', _ '04935 410618', '048 257 67 60 79'] Local $findnumb = _ ['882 8565','123 8762','7543010','07843 543287','00441619346534','+44208','0015417543012'] Consolewrite('---------------------------------------------------------------------------------------------------------------------'& @CRLF _ & '---------------------------------------------------------------------------------------------------------------------'& @CRLF) For $i = 0 to Ubound($findnumb)-1 ; find these numbers! $reference = StringRegExpReplace($findnumb[$i],"[^0-9]","") ; Santize Numbers For $a = 0 to ubound($aArray)-1 GLOBAL $m = 0 $dbnumbers = StringRegExpReplace($aArray[$a],"[^0-9]","") ; Sanitize Numbers $refNumT1 = $reference $refNumT2 = $reference if $reference = $dbnumbers Then Consolewrite('> Phone Number --] '& $findnumb[$i] & ' [--'& @CRLF) Consolewrite('+> Exact Match to --] '& $aArray[$a] & ' [-- row '& $a & @CRLF) EndIf IF StringLen($reference) < 7 then ; Find Partial Match at beginning of databasen number, through cyclical deleting of one character at a time from left or right of challenge number Do ; matches left to right of challenge number against db number IF StringLeft($dbnumbers,StringLen($refNumT1)) = $refNumT1 then Consolewrite('> Phone Number --] '& $findnumb[$i] & ' [-- using LAST '& StringLen($refNumT1) & ' digits'& @CRLF) consolewrite('+> Partial Match, matching FIRST '& StringLen($refNumT1)&' numbers ('& $refNumT2 &') of --] ' & $aArray[$a] & ' [-- row '& $a & @CRLF) EndIf $refNumT1 = StringTrimLeft($refNumT1,1) Until StringLen($refNumT1) = 1 OR StringLen($dbnumbers) = 10 Do ; matches right to left of challenge number against db number IF StringLeft($dbnumbers,StringLen($refNumT2)) = $refNumT2 then Consolewrite('> Phone Number --] '& $findnumb[$i] & ' [-- using FIRST '& StringLen($refNumT2) & ' digits'& @CRLF) consolewrite('+> Partial Match, matching FIRST '& StringLen($refNumT2)&' numbers ('& $refNumT2 &') of --] ' & $aArray[$a] & ' [-- row '& $a & @CRLF) exitloop EndIf $refNumT2 = StringTrimRight($refNumT2,1) Until StringLen($refNumT2) = 1 OR StringLen($dbnumbers) = 10 endif if StringInStr($dbnumbers,$reference) then ; Find Partial Match within the numbers database Consolewrite('> Phone Number --] '& $findnumb[$i] & ' [--'& @CRLF) Consolewrite('+> Partial Match, within larger number --] '& $aArray[$a] & ' [-- row '& $a & @CRLF) ;ContinueLoop EndIf $typos = _Typos($dbnumbers, $reference) ; Find Similar numbers based on limits $stringlen = Stringlen($dbnumbers) / StringLen($reference) $similarity = Stringleft(100-($stringlen*$typos),6) IF $similarity > 97.5 then Consolewrite('> Phone Number --] '& $findnumb[$i] & ' [--'& @CRLF) consolewrite('+> Similarity Match, '& $similarity &'% similar to number --] '& $aArray[$a] &' [-- row '& $a & @CRLF) EndIf Next Next Consolewrite('---------------------------------------------------------------------------------------------------------------------'& @CRLF _ & '---------------------------------------------------------------------------------------------------------------------'& @CRLF) Output --------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------- > Phone Number --] 882 8565 [-- +> Partial Match, within larger number --] (01) 882 8565 [-- row 16 > Phone Number --] 882 8565 [-- +> Partial Match, within larger number --] +44 207 882 8565 [-- row 32 > Phone Number --] 7543010 [-- +> Partial Match, within larger number --] +441347543010 [-- row 26 > Phone Number --] 00441619346534 [-- +> Similarity Match, 99% similar to number --] 00441619346434 [-- row 17 > Phone Number --] 00441619346534 [-- +> Similarity Match, 97.642% similar to number --] 0161 934 6534 [-- row 30 > Phone Number --] +44208 [-- using LAST 2 digits +> Partial Match, matching FIRST 2 numbers (44208) of --] 08457 128276 [-- row 5 > Phone Number --] +44208 [-- using LAST 2 digits +> Partial Match, matching FIRST 2 numbers (44208) of --] 0-800-022-5649 [-- row 8 > Phone Number --] +44208 [-- using FIRST 2 digits +> Partial Match, matching FIRST 2 numbers (44) of --] +441347543010 [-- row 26 > Phone Number --] +44208 [-- using FIRST 4 digits +> Partial Match, matching FIRST 4 numbers (4420) of --] +44 207 882 8565 [-- row 32 > Phone Number --] +44208 [-- using FIRST 4 digits +> Partial Match, matching FIRST 4 numbers (4420) of --] +44 20 7946 0321 [-- row 41 > Phone Number --] 0015417543012 [-- +> Similarity Match, 98.307% similar to number --] +1-541-754-3012 [-- row 25 --------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------- -
czardas reacted to a post in a topic: Directory Enquiries Challenge
-
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
I'm not sure that's completely accurate :-) A number doesn't have to belong to someone to be a "real number". There is, however, a difference between an assigned number and an unassigned number. The challenge (at least from what I understood) wasn't specifically to find real/fake or assignable/unassignable numbers, it was to match numbers from the reference list to the best possible means. -
Directory Enquiries Challenge
stamandster replied to czardas's topic in AutoIt General Help and Support
Seems there's two lines of reasoning to finding telephone numbers. First find only exact matches of the reference numbers or match the numbers within a larger number (even if reference numbers are mistyped or incorrect). The second line of reasoning is to define every type of phone number via rules and a table of known area, national, regional, etc. calling codes and don't look for the reference numbers. I've adjusted my code, based on the original request of the challenge, to look and find all the reference numbers and, from what I gathered, to find the most similar matches to up to a certain similarity limit (the whole "can have false positives"). One issue I noticed was the search for +44208... doesn't match ANYTHING unless you suppose that the numbers 08000225649 and 08457128276 are supposed to have +442 added to the beginning. Also added a piece that starts matching the original reference number to the left characters of the database numbers. It will one by one remove a character from the reference number to match the beginning of the database number. The reference number must be less than a certain string length in order to use this process. I may do similarly to the reverse, but haven't found it necessary, yet. #include <Array.au3> #include "typos.au3" #cs looking for 882 8565 123 8762 7543010 07843 543287 00441619346534 +44208.....missing numbers [optional task] 44208 0800275002 ; too short, japan local? 08000225649 ; 11 chars 08457128276 ; 11 chars 0015417543012 #ce GLOBAL $refNumT Local $aArray = _ ['+262 692 12 03 00', '1800 251 996', '+1 994 951 0197', _ '091 535 98 91 61', '2397865', '08457 128276', _ '348476300192', '05842 361774', '0-800-022-5649', _ '15499514891', '0096 363 0949', '04813137349', _ '06620 220168', '07766 554433', '047 845 44 22 94', _ '0435 773 4859', '(01) 882 8565', '00441619346434', _ '09314 367090', '0 164 268 0887', '0590995603', _ '991', '0267 746 3393', '064157526153', _ '0 719 829 7756', '+1-541-754-3012', '+441347543010', _ '03890 978398', '(31) 10 7765420', '020 8568 6646', _ '0161 934 6534', '0 637 915 1283', '+44 207 882 8565', _ '0800 275002', '0750 646 9746', '982-714-3119', _ '000 300 74 52 40', '023077529227', '1 758 441 0611', _ '0183 233 0151', '02047092863', '+44 20 7946 0321', _ '04935 410618', '048 257 67 60 79'] Local $findnumb = _ ['882 8565','123 8762','7543010','07843 543287','00441619346534','+44208.....missing numbers [optional task]','0015417543012'] Consolewrite('---------------------------------------------------------------------------------------------------------------------'& @CRLF) Consolewrite('---------------------------------------------------------------------------------------------------------------------'& @CRLF) For $i = 0 to Ubound($findnumb)-1 ; find these numbers! $reference = StringRegExpReplace($findnumb[$i],"[^0-9]","") ; Santize Numbers For $a = 0 to ubound($aArray)-1 GLOBAL $m = 0 $dbnumbers = StringRegExpReplace($aArray[$a],"[^0-9]","") ; Sanitize Numbers $refNumT = $reference if $reference = $dbnumbers Then Consolewrite('> Reference Phone Number --] '& $findnumb[$i] & ' [--'& @CRLF) Consolewrite('+> ^ Exact Match to --] '& $aArray[$a] & ' [-- row '& $a & @CRLF) EndIf IF StringLen($reference) < 7 then ; Find Partial Match at beginning of the database number Do IF StringLeft($dbnumbers,StringLen($refNumT)) = $refNumT then Consolewrite('> Reference Phone Number --] '& $findnumb[$i] & ' [-- using last '& StringLen($refNumT) & ' digits'& @CRLF) consolewrite('+> ^ Partial Match, matching first '& StringLen($refNumT)&' numbers of --] ' & $aArray[$a] & ' [-- row '& $a & @CRLF) EndIf $refNumT = StringTrimLeft($refNumT,1) Until StringLen($refNumT) = 1 OR StringLen($dbnumbers) = 10 endif if StringInStr($dbnumbers,$reference) then ; Find Partial Match within the numbers database Consolewrite('> Reference Phone Number --] '& $findnumb[$i] & ' [--'& @CRLF) Consolewrite('+> ^ Partial Match, within larger number --] '& $aArray[$a] & ' [-- row '& $a & @CRLF) ;ContinueLoop EndIf $typos = _Typos($dbnumbers, $reference) ; Find Similar numbers based on limits $stringlen = Stringlen($dbnumbers) / StringLen($reference) $similarity = Stringleft(100-($stringlen*$typos),6) IF $similarity > 97.5 then Consolewrite('> Reference Phone Number --] '& $findnumb[$i] & ' [--'& @CRLF) consolewrite('+> ^ Similarity Match, '& $similarity &'% similar to number --] '& $aArray[$a] &' [-- row '& $a & @CRLF) EndIf Next Next Consolewrite('---------------------------------------------------------------------------------------------------------------------'& @CRLF) Consolewrite('---------------------------------------------------------------------------------------------------------------------'& @CRLF) My output looks like so --------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------- > Reference Phone Number --] 882 8565 [-- +> ^ Partial Match, within larger number --] (01) 882 8565 [-- row 16 > Reference Phone Number --] 882 8565 [-- +> ^ Partial Match, within larger number --] +44 207 882 8565 [-- row 32 > Reference Phone Number --] 7543010 [-- +> ^ Partial Match, within larger number --] +441347543010 [-- row 26 > Reference Phone Number --] 00441619346534 [-- +> ^ Similarity Match, 99% similar to number --] 00441619346434 [-- row 17 > Reference Phone Number --] 00441619346534 [-- +> ^ Similarity Match, 97.642% similar to number --] 0161 934 6534 [-- row 30 > Reference Phone Number --] +44208.....missing numbers [optional task] [-- using last 2 digits +> ^ Partial Match, matching first 2 numbers of --] 08457 128276 [-- row 5 > Reference Phone Number --] +44208.....missing numbers [optional task] [-- using last 2 digits +> ^ Partial Match, matching first 2 numbers of --] 0-800-022-5649 [-- row 8 > Reference Phone Number --] 0015417543012 [-- +> ^ Similarity Match, 98.307% similar to number --] +1-541-754-3012 [-- row 25 --------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------