gr1fter 0 Posted July 27, 2011 Hello. I have a log file: Example of text file THERE ARE LOTS OF VALUES IN THIS TEXT FILE BUT I ONLY WANT TO RETRIEVE WHAT IS IN BETWEEN THE EXIT CODE VALUES <ExitCode>14566</ExitCode> I would like to search that log file and only get what is between the <ExitCode>??????</ExitCode> markers. Can you help me with this please, I have an example and I can find the position in number format, but I dont know where to go from there to get the actual value. Do i want to string left from there?? $file = FileRead("C:\test.log") $result = StringInStr($file, "</ExitCode>") if $result then MsgBox(0, "Found it", "Found it at character position: " & $result) Else MsgBox(0, 'Not Found', "String Not Found") EndIf Thanks, Share this post Link to post Share on other sites
smartee 14 Posted July 27, 2011 Look in the help-file for _StringBetween(), StringRegExp() Share this post Link to post Share on other sites
gr1fter 0 Posted July 27, 2011 Look in the help-file for _StringBetween(), StringRegExp() Sweeet! Did not see that one. This is what I did and it worked perfectly #Include <String.au3> $file = FileRead("C:\test.log") $aArray1 = _StringBetween($file, "<ExitCode>","</ExitCode>",-1) MsgBox(48,"",$aArray1[0]) Share this post Link to post Share on other sites
gr1fter 0 Posted July 27, 2011 Look in the help-file for _StringBetween(), StringRegExp() Thanks for your help Share this post Link to post Share on other sites