sammy1983 Posted January 14, 2014 Author Posted January 14, 2014 On 1/14/2014 at 5:36 PM, jdelaney said: Consolewrite the $Desc, and post it back. Consolewrite the $newString and post it back, also Consolewrite ($Desc): 285904MP PM1163875 net worth performance displaying incorrect numbers. ConsoleWrite($newString): PM1163875 net worth performance displaying incorrect numbers.
jdelaney Posted January 14, 2014 Posted January 14, 2014 (edited) Here you go: $string = "285904MP" & @CRLF & "PM1163875" & @CRLF & "net worth performance displaying incorrect numbers." $aString = StringRegExp($string,"(PM\d{7})",3) $newString=$aString[0] ConsoleWrite($newString & @CRLF) or: $string = "285904MP" & @CRLF & "PM1163875" & @CRLF & "net worth performance displaying incorrect numbers." $aString = StringRegExpReplace($string,"(?s).*(PM\d{7}).*","$1") ConsoleWrite($aString & @CRLF) Edited January 14, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
sammy1983 Posted January 14, 2014 Author Posted January 14, 2014 On 1/14/2014 at 5:57 PM, jdelaney said: Here you go: $string = "285904MP" & @CRLF & "PM1163875" & @CRLF & "net worth performance displaying incorrect numbers." $aString = StringRegExp($string,"(PM\d{7})",3) $newString=$aString[0] ConsoleWrite($newString & @CRLF) or: $string = "285904MP" & @CRLF & "PM1163875" & @CRLF & "net worth performance displaying incorrect numbers." $aString = StringRegExpReplace($string,"(?s).*(PM\d{7}).*","$1") ConsoleWrite($aString & @CRLF) You are amazing. It worked. Jus one hurdle. I am getting error if this PMxxxxx is not present in textbox. Is it possible to ignore and let the script run? ==> Subscript used on non-accessible variable.: $newString1=$aString[0] $newString1=$aString^ ERROR
jdelaney Posted January 14, 2014 Posted January 14, 2014 If IsArray($aString) Then your code to add to excel EndIf IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
sammy1983 Posted January 14, 2014 Author Posted January 14, 2014 On 1/14/2014 at 6:17 PM, jdelaney said: If IsArray($aString) Then your code to add to excel EndIf This is my code: $aString = StringRegExp($YodleeDesc,"(PMd{7})",3) $newString1=$aString[0] If IsArray($aString) Then _ExcelWriteCell($oExcel, $newString1, $i, 3) Else _ExcelWriteCell($oExcel, "No Maximo#", $i, 3) EndIf and I am getting below error ==> Subscript used on non-accessible variable.: $newString1=$aString[0] $newString1=$aString^ ERROR
jdelaney Posted January 14, 2014 Posted January 14, 2014 (edited) If it's not an array, you can't assign a subscript to a variable...add that into the If statement, where it is an array. $aString = StringRegExp($YodleeDesc,"(PM\d{7})",3) If IsArray($aString) Then $newString1=$aString[0] _ExcelWriteCell($oExcel, $newString1, $i, 3) Else _ExcelWriteCell($oExcel, "No Maximo#", $i, 3) EndIf Edited January 14, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
sammy1983 Posted January 14, 2014 Author Posted January 14, 2014 On 1/14/2014 at 6:32 PM, jdelaney said: If it's not an array, you can't assign a subscript to a variable...add that into the If statement, where it is an array. $aString = StringRegExp($YodleeDesc,"(PM\d{7})",3) If IsArray($aString) Then $newString1=$aString[0] _ExcelWriteCell($oExcel, $newString1, $i, 3) Else _ExcelWriteCell($oExcel, "No Maximo#", $i, 3) EndIf Hey jdelaney, it worked like a charm.. Thanks so much.. Can I take liberty to ask another question regarding same?
sammy1983 Posted January 14, 2014 Author Posted January 14, 2014 On 1/14/2014 at 7:06 PM, sammy1983 said: Hey jdelaney, it worked like a charm.. Thanks so much.. Can I take liberty to ask another question regarding same? Hi jdelaney, it was awesome working with u. You resolved my query and thanks a ton for being patient with me. Thanks again.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now