Sign in to follow this  
Followers 0
TeamShovel

Help: Gather text from file

2 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 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 :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0