ryantollefson Posted March 17, 2015 Share Posted March 17, 2015 I'm trying to find the last decimal number from a text file. Problem is that the array that is returned will return multiple values, but only from the first line in which they occur, not from additional lines in the file. $tmpTxt = "tmptxt.txt" $aFile = FileOpen($tmpTxt) $file = FileRead($aFile) $regex = StringRegExp($file,'([0-9]{1,5}\.[0-9]{2})(.*)', 1) Thanks for any help you can provide. Link to comment Share on other sites More sharing options...
Solution ryantollefson Posted March 17, 2015 Author Solution Share Posted March 17, 2015 Never mind... guess I just needed to post a stupid question publicly and the answer would come to me. $regex = StringRegExp($file,'([0-9]{1,5}\.[0-9]{2})', 3) Wrong flag for StringRegExp. Link to comment Share on other sites More sharing options...
mpower Posted March 17, 2015 Share Posted March 17, 2015 Sometimes it just helps to put write your problems down and the answer will present itself in the process or shortly after, as you demonstrated here. Please mark it as solved with your second post as no doubt someone else would have this problem in the future and your post could help them solve it! Link to comment Share on other sites More sharing options...
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