TeamShovel Posted June 14, 2011 Share Posted June 14, 2011 Hello I cant find the right way to pull only the text I want from a file. Im using OCR to get the text from a window due to not being able find the text. In result I get a lot of other random gibberish. I need to pull only the number data I want. the line with annotation. I wish to use that line for math so the decimal and negative need to be correct. This all might be easier to work with if I had a better OCR. - Example Text: 4c% 1’— V H I I, Annotation 2: 'test1' at [-6681.399,250.88957,5476.6035] II (J I I xl. L/ L Link to comment Share on other sites More sharing options...
enaiman Posted June 14, 2011 Share Posted June 14, 2011 (edited) A simple StringRegExp will do the trick: $var = " [-6681.399,250.88957,5476.6035]" $tt = StringRegExp($var, "\-*\d+\.\d+,\-*\d+\.\d+,\-*\d+\.\d+", 1) ConsoleWrite($tt[0]&@CRLF) Use FileRead and use StringRegExp. Edited June 14, 2011 by enaiman SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) 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