Jump to content
Macro Express Forums

Capturing data and parsing it


Recommended Posts

Hello Macro Allstars !


I have a very specific need. I have a macro running in a telnet client. Occasionally, I would like to evaluate some of the data in the window. Is there a direct way to look in the focus window for specific text and then take <n> chars after that text and put it into a variable ?


I've found a way to get all of the text on the screen onto the clipboard with recorded mouse clicks but I'd like to do it cleaner than that if possible. Assuming though that I have to go this route, the top line will have the data I need to look at. It will be something along this line:


"You have processed 350 records today"


I want to get 350 into a variable. It doesn't even need to be an int. It can be a string.


Please help :)

Thank you in advance!

Link to comment
Share on other sites

Text Type: <CONTROL>a---->if it's possible to do a select all in telnet
Clipboard Copy
Variable Set String %T1% from Clipboard
Variable Modify String: Copy Part of %T1% to %T2% ---> this would copy the 350. you set the starting position and tell it how many characters to copy
Text Box Display: Show T2 --->would show 350


hopefully that helps some.

Link to comment
Share on other sites

This works but I run into problems when I move from my docking station to just my laptop because of the difference in resolution and the changing of positions that I make the macro click. However, I have found that I can log my telnet session to a log file. I can then dump that log file into a variable. I can execute a command, read the log into a string variable (%T1%) and then the data I'm looking for is on the last line. I see that there is a command to see if a variable contains a value. Is there a way to determine the position of that data ? That would certainly solve my issue completely.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...