
Sam137
Active Members-
Posts
72 -
Joined
-
Last visited
Everything posted by Sam137
-
Hello all I have a code the following code: Main Code: ******************************* $NextTest = "MulMovAllNotExistEnc()" _RunLoadData1($UpdateStatus3, $LoadINI, $UpdateStatus4,$StartStep,$EndStep,$CurrTest,$NextTest) ********************************* Here MulMovAllNotExistEnc() is the name of the function. Func MulMovAllNotExistEnc() Msgbox(0,"","I am here") EndFunc Called fuction Code: ****************************** Func _RunLoadData1($UpdateStatus3, $LoadINI1, $UpdateStatus4,$StartStep,$EndStep,$CurrTest,$NextTest) if $StrMessage = 0 Then ; Lets keep some condition is not satisfied MsgBox(16,"Message Not Found","Step 5 was failing in "& $CurrTest & " test, hence continuing with next test") $NextTest EndFunc ****************************** Problem: When the code passes through the if loop, it should call the MulMovAllNotExistEnc() function. Its giving the error. Can you please help.
-
Hi Guys I have two RTF files. I want it to compare the two files every line and every word and report the differences logically if found any. My main constraint is, we do not have any line numbers like we have in a notepad and textpad. If that is present in RTF, then i could say for example: Line 023 in File1 is "ABC" Line 023 in File2 is "DEF". I have no clue how can i proceed as there is no standard template. Any idea is welcome. Sample.RTF Sample1.rtf
-
Hello All I have an array which is declared as Local $aArray[5]. And I load some values in the array elements. Local $aArray[0] = ["Test1+000"] or it may be spaces Local $aArray[1] = ["Test2+001"] or it may be spaces Local $aArray[2] = ["Test3+002"]or it may be spaces Local $aArray[3] = ["Test4+003"]or it may be spaces At the end i want to write a particular cell Only the array elements which is NOT spaces. If $aArray[0] <> "" or $aArray[1] <> "" or $aArray[2] <> "" or $aArray[3] <> ""Then _ExcelWriteArray($oExcel, 10, 5, $aArray) End If For example: Local $aArray[0] = "" Local $aArray[1] = ["Test2+001"] Local $aArray[2] = "" Local $aArray[3] = ["Test4+003"] The from the above coding i need to get the result as below stored in the cell 10,5 in the excel: Test2+001 @newline Test4+003 How can i attain this? When i execute the coding which is mentioned above it says, Subscript has incorrect values or exceeded. Pls help.
-
Help with "StringRegExp" function
Sam137 replied to Sam137's topic in AutoIt General Help and Support
But the alignment is getting changed. Its going to the first position. I would want something like in the attacheed file. Example.txt -
Help with "StringRegExp" function
Sam137 replied to Sam137's topic in AutoIt General Help and Support
@jchd - Thanks for the help. I like to get the information how to modify it when i have a 2 or more strings to seach and replace with another. Currently what i have given is to search only for "filepath****************= ". Now i have more strings to search for example "logpath****************= " and "errorpath****************= ". The problem is I dont have a starndard replacement string for all the three. In one single file: "filepath****************= " has to be replaced by "C:Multi DDt Delete Encounter MPIcleanup.in" "logpath****************= " has to be replaced by "D:Testtestup.in" "errorpath****************= " has to be replaced by "E: Encounter MPItesting.in" how can i change the below string to cater this. Local $newtext = StringRegExpReplace($text, "(?im)(^s*filepath[^=]*=)(.*)", "$1C:Multi DDt Delete Encounter MPIcleanup.in") -
Help with "StringRegExp" function
Sam137 replied to Sam137's topic in AutoIt General Help and Support
Ok, my requirement is: I have a folder which contains 'n' number of files. I want to open the first file and search for the string "filepath****************= " Remember * as spaces and then i delete the remaining part of the string i.e."e:\autitMulti\ Encounter MPI\cleanup.in" , after deleting the second fragment we have only left with "filepath****************= " then i replace with "filepath****************= C:\Multi DDt Delete Encounter MPI\cleanup.in". See an example of the file in the attachment. Example.txt -
Help with "StringRegExp" function
Sam137 replied to Sam137's topic in AutoIt General Help and Support
"e:autitMulti Encounter MPIcleanup.in" is not consistent with all the files it keeps on changing, the only thing which is consistent is : "filepath****************=" -
Help with "StringRegExp" function
Sam137 replied to Sam137's topic in AutoIt General Help and Support
Well I can use String Replace, but the problem is : Actual whole string in the file is: "filepath****************= e:autitMulti Encounter MPIcleanup.in" First thing i want to search for the string: "filepath****************= " Remember * as spaces and then i delete the remaining part of the string i.e."e:autitMulti Encounter MPIcleanup.in" then i replace with "filepath****************= C:Multi DDt Delete Encounter MPIcleanup.in". I think it will be a tedious job in string Replace. Any suggestions? -
Help with "StringRegExp" function
Sam137 replied to Sam137's topic in AutoIt General Help and Support
Okay well, I am searching for the below string in the file. "filepath****************= " If this is found then i want to replace it with: "filepath****************= C:Multi DDt Delete Encounter MPIcleanup.in" NOTE: Please consider all * as spaces. For that i have the below coding. But its not working. If StringRegExp($sStr, "(?im)^(filepathh*=h*[^v]+)") Then $sNewStr = StringRegExpReplace($sStr, "(?im)^(filepath)(h*=h*)([^v]+)", "$1$2" & _ StringRegExpReplace("C:Multi DDt Delete Encounter MPIcleanup.in", "()", "")) -
Hi Guys Can you please help me out with the pattern of the one which is below: Pattern to look: "filepath = " There are 16 spaces between "filepath" and "= " If StringRegExp($sStr, "(?im)^(filepathh*=h*[^v]+)") Then $sNewStr = StringRegExpReplace($sStr, "(?im)^(filepath)(h*=h*)([^v]+)", "$1$2" & _ StringRegExpReplace("C:Multi DDt Delete Encounter MPIcleanup.in", "()", "")) $sStr is the file which is returned from the Fileread command. I Just want to know how the code the pattern.
-
Find & Replace with little tweaks
Sam137 replied to Sam137's topic in AutoIt General Help and Support
It just contains only the file name as search.in -
Find & Replace with little tweaks
Sam137 replied to Sam137's topic in AutoIt General Help and Support
The code which i given is only a part. I have already used that and for me arraydisplay works perfect.#include <File.au3> #include <Array.au3> Local $sNewStr Local $sReplaceStr = "d:usersearch.in" Local $var = FileSelectFolder("Choose a folder.", "c:", 7, @ScriptDir & "") If @error Then Exit Local $FileList = _FileListToArray($var, "*.in?") If @error Then Exit ;_ArrayDisplay($FileList, "$FileList") For $i = 1 To UBound($FileList) - 1 $open = FileOpen($FileList[$i],2) msgbox(0,"",$open) $sStr = FileRead($FileList[$i]) msgbox(0,"",$sStr) If StringRegExp($sStr, "(?im)^(filepath|logpathh*=h*[^v]+)") Then $sNewStr = StringRegExpReplace($sStr, "(?im)^(filepath|logpath)(h*=h*)([^v]+)", "$1$2" & _ StringRegExpReplace($sReplaceStr, "()", "")) ;ConsoleWrite("======== Contents of " & $var & "" & $FileList[$i] & " ========" & @LF) ;ConsoleWrite($sNewStr & @LF) ;ConsoleWrite("========================================================================" & @LF) msgbox(0,"",$sNewStr) $file = FileOpen($FileList[$i],2) FileWrite($file,$sNewStr) FileClose($file) ShellExecute($FileList[$i]) ; View actual file EndIf Next -
Find & Replace with little tweaks
Sam137 replied to Sam137's topic in AutoIt General Help and Support
I added some message boxes for the fileread, its returning spaces. And then i realized that i am going wrong(not sure) so added Fileopen, its returning 1 but the fileread is returning spaces....For $i = 1 To UBound($FileList) - 1 $open = FileOpen($FileList[$i],2) msgbox(0,"",$open) $sStr = FileRead($FileList[$i]) msgbox(0,"",$sStr) If StringRegExp($sStr, "(?im)^(filepath|logpathh*=h*[^v]+)") Then $sNewStr = StringRegExpReplace($sStr, "(?im)^(filepath|logpath)(h*=h*)([^v]+)", "$1$2" & _ StringRegExpReplace($sReplaceStr, "()", "")) ;ConsoleWrite("======== Contents of " & $var & "" & $FileList[$i] & " ========" & @LF) ;ConsoleWrite($sNewStr & @LF) ;ConsoleWrite("========================================================================" & @LF) msgbox(0,"",$sNewStr) $file = FileOpen($FileList[$i],2) FileWrite($file,$sNewStr) FileClose($file) ShellExecute($FileList[$i]) ; View actual file EndIf Next -
Find & Replace with little tweaks
Sam137 replied to Sam137's topic in AutoIt General Help and Support
Thanks so much for the quick turnaround. I tried the above coding and its not replacing the striing as per the requirement. Moreover i could not understand $sNewStr = StringRegExpReplace($sStr, "(?im)^(filepath|logpath)(h*=h*)([^v]+)", "$1$2" & _ StringRegExpReplace($sReplaceStr, "()", "")) I went through the help file for the function StringRegExpReplace. It will be good can anyone help where i am going wrong. -
Hello I have a typical requirement. I have a folder which contains n number of files. I have a partial search string with me and i do have a full replace string also with me. Suppose consider the file contains: *************************** filepath = c:\test\search.in logpath = c:\test\search.in *************************** 1. The code is to first search for "filepath =" and it should extract the full sentence "filepath = c:\test\search.in" and do a replace with the string "filepath = d:\user\search.in". 2. Next the code is to search for "logpath =" and it should extract the full sentence "logpath = c:\test\search.in" and do a replace with the string "logpath = d:\user\search.in". Like this i have to do in all the files which i have in the folder. Is this possible using Autoit?
-
Thanks Melba so much for your valuable time.
-
Then for this problem do I need to increase the array limit in EXCELCOM_UDF?
-
i have copied the excel.au3 UDF from this website officially. I am not getting the error frequently. Suppose i have some 20 records, say i am getting the error at 16 record or so. If you assume that i have been using the wrong excel.au3 UDF. please provide me with the correct one, i will copy and paste it.
-
Its returning Row =0 and column = 0, Can anyone help me out this. Also I do not know what do you mean by $aFound[1][3], $aFound[1][2]
-
Can anyone please help on this array error
-
I have the coding : $aFound = _ExcelFindInRange($oExcel, $ConcatVal, "F1:F200") if @error then exit msgbox(0,"","error finding string. @error = " & @error) _ExcelWriteCell($oExcel, "Yes", $aFound[1][3], $aFound[1][2] - 1) if @error then exit msgbox(0,"","error writing text. @error = " & @error) _ExcelBookSave($oExcel) I get the error as attached only sometimes. Not everytime. I dont know what is going on. Please help.
-
Help in comparing 2 RTF files of the same format
Sam137 replied to Sam137's topic in AutoIt General Help and Support
I dont this this will work for my requirement or not. I want to the reporting to be my custom format in a text file saved in a location which i specify. -
Help in comparing 2 RTF files of the same format
Sam137 replied to Sam137's topic in AutoIt General Help and Support
These tools are not going to be helpful in my case. I have 2 folders - New and Old Environements In each folders I will have atleast 50 + files. So my requirement is i need to go to the OLD folder and search for the same file name in the NEW folder and compare the 2 files and is any differences found I should report in an text format. -
Thanks that was perfectly worked