waiting for text in hyperterminal?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
tmallardi
Newbie
Posts: 13
Joined: Tue Jul 08, 2003 1:50 am
Location: Dallas, TX, USA

waiting for text in hyperterminal?

Post by tmallardi » Tue Jul 08, 2003 2:06 am

I'm attempting to automate a task that we perform on a daily basis. This task involves the following steps:

1. dialing up to a remote host using Hyperterminal
2. logging in
3. requesting a report
4. then capturing the report to a text file.

I'm trying to figure out if there's a way for my script to wait for a specific prompt (text string) to appear before beginnning the text capture. I really can't rely on the "wait" command because the report always takes a different amount of time to generate before beginning to scroll on the screen.

Any ideas would be greatly appreciated.

Thanks,
Tim

Lumumba

Post by Lumumba » Tue Jul 08, 2003 6:09 am

Sorry, no hyperterminal available on my box.

Would it be possible to get the report if you dial in with "rasphone.exe" (from the commandline), and a download via FTP?

Is there an option in HT, that a log can be written/piped while the processing (like it is with Telnet)?

If yes, no afterwards capturing is necessary.

tmallardi
Newbie
Posts: 13
Joined: Tue Jul 08, 2003 1:50 am
Location: Dallas, TX, USA

Post by tmallardi » Tue Jul 08, 2003 3:10 pm

During this terminal session, the user must request a report. It then takes from 5 to 30 seconds before the report begins.

I prefer to begin Hyperterminal's text capture command when a certain string is encountered on the report. Otherwise, I'll end up having to capture a bunch of preliminary user input.

I was hoping there's a technique to monitor a stream of data with MacroScheduler.

Lumumba

Post by Lumumba » Tue Jul 08, 2003 3:59 pm

But if there's an option to capture the output:

a) Check for the keyword/trigger
b) if it isn't matching, ignore it
c) if yes keep/pipe it

Code: Select all

Let>trigger=User: John Doe

Label>TriggerIt
//Let's assume it's possible to capture the output to the clipboard
GetClipboard>line
If>line=%trigger%,Gotcha,TriggerIt

Label>Gotcha
GetClipboard>line
If>line=,Exit
WLN>C:\test.txt,Result,%line%
Goto>Gotcha

Label>Exit
Well, just something to play with ...

tmallardi
Newbie
Posts: 13
Joined: Tue Jul 08, 2003 1:50 am
Location: Dallas, TX, USA

Post by tmallardi » Tue Jul 08, 2003 4:26 pm

Very interesting approach!

Hyperterminal can't capture to the clipboard. However, based on your concept, Im going to try this.

1. begin text capture to a temp file.

2. perform Readln on temp file until trigger is encountered.

3. stop text capture to temp file

4. start text capture to final file

I'll give that a try and see what happens.

Thanks!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts