Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invoking Procomm's FIND in scrollback tool in a script?

Status
Not open for further replies.

malium

ISP
Jun 26, 2003
23
0
0
US
I'd like to be able to pop up the Find window from within a script. Is there a way to do this? I vaguely recall seeing what looked like a list of numeric references to Procomm system menu items but can't locate it.

Also, I'd like to be able to find and parse some entire lines of date from a large chuck of data, or data on following lines after a relevant string to present some info and values.

Am I correct in thinking I'll need to log to a file then parse the file?

Is there a way to turn on/off what gets written to screen so I could have the data write to a file or buffer to be parsedbut not cause the user to seescreens of data fly by into the scrollback buffer?

- Malcolm
 
The file you are thinking about is pw5menu.inc. To activate the Edit | Find menu item, your script would need this line:

menuselect PWMENU 210

I find it easier to save incoming data to a file to parse it, but you could use when target or waitfor to identify a string (such as a prompt) identifying some data is about to appear, then use an rget command to read the rest of the line. You could also use rget to read line by line, then use strfind to search for a prompt in that line to see if it's one you are interested in.

There's not an immediate way to save data to a file without it showing on the screen. Probably the best way to do this is to use rget to read incoming data line by line (rget will grab data without diplaying it on the screen), then use fputs or fwrite to save the data to a text file. You may need to do some cleanup of the line so the proper number of carriage returns and/or linefeeds are written to the file. You can use the set aspect rgetchar command with the STRIP keyword to remove a trailing carriage return or linefeed if needed, or use strreplace as well.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top