Leaderboard
Popular Content
Showing content with the highest reputation on 08/23/2017 in all areas
-
For the 2) , here is a way : ; remove empty lines at beginning of file and spaces at beginning of lines $newString = StringRegExpReplace($string, "^\R+\h*|\R\K\h+", "") ;replace multiple empty lines between paragraphs with one line and multiple spaces inside of line with one space $newString = StringRegExpReplace($newString, "\R{2}\K\R+|\h\K\h+", "") ; if after that first character in line is lowercase and previous line is not empty then merge it with previous line, otherwise keep line unchanged $newString = StringRegExpReplace($newString, "\V+\K\R(?=[[:lower:]])", "")1 point
-
Sometimes it would help when one first dumb things down to the basics to show their issue. Have a look at this and see if you can figure out why you get your "error": #include <Array.au3> Local $abc[2] = [0, 1] ConsoleWrite('_ArraySearch($abc, "ABC") = ' & _ArraySearch($abc, "ABC") & ' >Error code: ' & @error & @CRLF) ConsoleWrite('_ArraySearch($abc, 0) = ' & _ArraySearch($abc, 0) & ' >Error code: ' & @error & @CRLF) ConsoleWrite('_ArraySearch($abc, 1) = ' & _ArraySearch($abc, 1) & ' >Error code: ' & @error & @CRLF) ConsoleWrite('_ArraySearch($abc, "ABC", Default, Default, Default, 3) = ' & _ArraySearch($abc, "ABC", Default, Default, Default, 3) & ' >Error code: ' & @error & @CRLF) ConsoleWrite('_ArraySearch($abc, 0, Default, Default, Default, 3) = ' & _ArraySearch($abc, 0, Default, Default, Default, 3) & ' >Error code: ' & @error & @CRLF) ConsoleWrite('_ArraySearch($abc, 1, Default, Default, Default, 3) = ' & _ArraySearch($abc, 1, Default, Default, Default, 3) & ' >Error code: ' & @error & @CRLF) Jos1 point
-
algiuxas, During your time here you appear not to have read the Forum rules. Please do read them - particularly the bit about not discussing the "Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc." - before you post again and then you will understand why you will get no help and this thread will now be locked. M231 point
-
Only way I know is to run some sort of VM software with instances of each flavor of windows and simply test it. Jos1 point
-
How exactly do you want the output to look like in the second input? Give examples of what you put in 1 and how it should look in 2. Also, there's no reason to use ControlCommand in this script.1 point
-
This example assumes the last two elements of the generated array always require the same string manipulation as displayed in Post #1 Output. Local $Input = _ "sajfkjdsaf" & @CRLF & _ "name" & @CRLF & _ "ajhsdfkajfdajsjdflkjafa" & @CRLF & _ "afdhjsahlfkaf" & @CRLF & _ "ajfkhdsakfasf" & @CRLF & _ "akjfkjafd" & @CRLF & _ "name" & @CRLF & _ "asfjksajf" & @CRLF & _ "kdajsfpa" & @CRLF & _ "alkdshfahsf" & @CRLF & _ "nameajslkfja" & @CRLF & _ "aslkfajnbfajn" $s = StringSplit($Input & "name" & @CRLF, "name" & @CRLF, 1) ; $STR_ENTIRESPLIT (1) = entire delimiter string is needed to mark the split $iLRI = UBound($s) - 1 ; Last Array Index $s[$iLRI] = @CRLF & StringRegExpReplace($s[$iLRI - 1], "^.+\v+(?s)(.+)$", "$1") ; Add preceeding line feed, and, remove first line of $s[2nd last array index]. This become $s[last array index]. $s[$iLRI - 1] = @CRLF & $s[$iLRI - 1] & @CRLF & StringRegExpReplace($s[$iLRI - 1], "(^.+\v+)(?s).+$", "$1") ; Add preceeding line feed, and, add copy of first line of $s[2nd last array index to end of $s[2nd last array index] Local $sDisplay = "Output;" & @CRLF For $i = 1 To UBound($s) - 1 $sDisplay &= "$s[" & $i & "]: " & $s[$i] Next ;ConsoleWrite($sDisplay & @CRLF) MsgBox(0, "Results", $sDisplay) #cs ; From Post #1 Output: $s[1]: sajfkjdsaf $s[2]: ajhsdfkajfdajsjdflkjafa afdhjsahlfkaf ajfkhdsakfasf akjfkjafd $s[3]: asfjksajf kdajsfpa alkdshfahsf nameajslkfja aslkfajnbfajn asfjksajf $s[4] kdajsfpa alkdshfahsf nameajslkfja aslkfajnbfajn #ce1 point
-
@LarsJ, You still read me as if I recommended a 100 * 100 nested loop, which is absolutely not the idea of a linear scan of both inpurt arrays in parallel. I place myself in the OP case of comparing presumably comparable directories to find out differences (files in X but not in Y or vice-versa). Obviously when inputs are not expectedly and essentially comparable, things depend on other considerations. I'll try to put an example together soon.1 point
-
I think it's necessary to use StringCompare to handle special national characters and unicode strings. _ArraySort is implemented with StringCompare. But _ArrayBinarySearch is coded with the simple comparison operators. I think it should have been StringCompare to be able to handle all strings.1 point
-
water, it's not very clear but input and output are written in the provided text - I suppose so sree161 You might try StringSplit with "name" as delimiter and the flag $STR_ENTIRESPLIT1 point
-
@Wanarmal, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. Jos1 point
-
You know what, I am just going to assume that the label tag comes right after the title tag, since that is the only example you will give. Since that is the case, try this. WARNING: Make copy of the xml file you want to use with this script. I am not responsible for damages suffered if this warning is not considered. Also since you for some reason don't want to supply a sample xml for me to test with, so here you go: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include <FileConstants.au3> ; *** End added by AutoIt3Wrapper *** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.0 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <File.au3> #include <Array.au3> $thefile = FileOpenDialog ( "Select the XML", "", "XML Files (*.xml)", 3 ) $file = FileOpen ( $thefile, $FO_UTF8_NOBOM ) $arr = FileReadToArray ( $file ) FileClose ( $file ) _ArrayDisplay ( $arr ) $ind = _ArrayFindAll ( $arr, "Title", Default, Default, Default, 1 ) For $i = 0 To UBound ( $ind ) - 1 Step 1 If StringInStr ( $arr[$ind[$i] + 1], "Label" ) > 0 Then $start = StringInStr ( $arr[$ind[$i] + 1], '"', Default, 3 ) $end = StringInStr ( $arr[$ind[$i] + 1], '"', Default, 4 ) $cont = StringMid ( $arr[$ind[$i] + 1], $start, ($end - $start) + 1 ) $arr[$ind[$i]] = StringReplace ( $arr[$ind[$i]], '""', $cont ) $arr[$ind[$i] + 1] = StringReplace ( $arr[$ind[$i] + 1], $cont, '""' ) _FileWriteToLine ( $thefile, $ind[$i] + 1, $arr[$ind[$i]], True ) _FileWriteToLine ( $thefile, $ind[$i] + 2, $arr[$ind[$i] + 1], True ) Else ContinueLoop EndIf Next1 point
-
How combine autoit and ranorex?
zaraijamel reacted to Germut for a topic
I want click button on Viber main windows. Because its write on QT in AU3 info i cannot find any controls. In ranorex spy i see several controls. At now i want click on button, but cannot understand how get control handle with autout? I want one interesting param in ranorex spy - BaseType. I think its may help me...1 point -
Need to create a icon on the all users desktop
behdadsoft reacted to MARAN for a topic
FileCreateShortcut(@WindowsDir & "\notepad.exe", @DesktopCommonDir & "\Shortcut to Notepad.lnk", @WindowsDir)1 point