So, I want autoit to use CTRL+SHIFT and RIGHT to select the text, but, when it selects it, it goes with all the spaces too, like:

a *space**space**space**space**space**space**space*

not

a

If the spaces were the same amount (like 12 spaces or smth like that, I would've use the replace tool from WordPad and replace the spaces with nothing so that the script can select only the number(or text) that i want to select.

That`s the script ATM, I need to make it someway to get the whole word after ARGV: because some words are okey, like 123456, and when it goes by CTRL SHIFT RIGHT, it selects 123456, but some are like 1@3456, so when it goes by CTRL SHIFT RIGHT, it selects only 1@ because it gets @ like a break.

Share this post

Link to post

Share on other sites

enaiman 13

I've put a little bit of work in this script - it gets all the content in array elements - to retrieve the content you need it is easy once you are a bit familiar with arrays.

Second part of the script is just as a demo.

Read the comments.

#Include <Array.au3>#Include <File.au3>#Include <String.au3>Dim$MyArray[4];comment this (testing);Dim $MyArray ;YOU NEED To Use THIS line;_FileReadToArray("my log file here", $MyArray) ;YOU NEED To Use THIS line$MyArray[0]=3$MyArray[1]="NR: 8.61.24.57 NAME: x1 ARGV: 123 * bad";comment this (testing)$MyArray[2]="NR: 86.12.45.78 NAME: x12 ARGV: 1234 * bad";comment this (testing)$MyArray[3]="NR: 861.2.45.789 NAME: x123 ARGV: 12345 * [b][color=red]good[/color][/b]";comment this (testing)Dim$MyResultArray[$MyArray[0]+1][4]$temp=""For$i=1To$MyArray[0]$temp=_StringBetween($MyArray[$i],"NR:","NAME")$MyResultArray[$i][0]=StringStripWS($temp[0],3)$temp=_StringBetween($MyArray[$i],"NAME:","ARGV")$MyResultArray[$i][1]=StringStripWS($temp[0],3)$temp=_StringBetween($MyArray[$i],"ARGV:","*")$MyResultArray[$i][2]=StringStripWS($temp[0],3)$temp=StringMid($MyArray[$i],StringInStr($MyArray[$i],"* "))$MyResultArray[$i][3]=StringStripWS($temp,3)Next_ArrayDisplay($MyResultArray);The following part is optional and I did it just for educational purpose;Up to this point you have an array containig all the entries in your log file;to see if an entry is good or bad - you need to test only the [3] element from every row.;;To fully benefit out of this example, you need to red about arrays and to have a play with themDim$MyGoodArray[1][4]Dim$MyBadArray[1][4]_GetGoodEntries($MyResultArray)_ArrayDisplay($MyGoodArray,"Good Entries")_GetBadEntries($MyResultArray)_ArrayDisplay($MyBadArray,"Bad Entries")Func_GetGoodEntries(ByRef$ARR)Local$counter=0For$i=1ToUBound($ARR)-1IfStringInStr($ARR[$i][3],"good")ThenReDim$MyGoodArray[$counter+1][4]$MyGoodArray[$counter][0]=$ARR[$i][0]$MyGoodArray[$counter][1]=$ARR[$i][1]$MyGoodArray[$counter][2]=$ARR[$i][2]$MyGoodArray[$counter][3]=$ARR[$i][3]$counter+=1EndIfNextEndFuncFunc_GetBadEntries(ByRef$ARR)Local$counter=0For$i=1ToUBound($ARR)-1IfStringInStr($ARR[$i][3],"bad")ThenReDim$MyBadArray[$counter+1][4]$MyBadArray[$counter][0]=$ARR[$i][0]$MyBadArray[$counter][1]=$ARR[$i][1]$MyBadArray[$counter][2]=$ARR[$i][2]$MyBadArray[$counter][3]=$ARR[$i][3]$counter+=1EndIfNextEndFunc

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script