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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help capturing info from a data-stream

Status
Not open for further replies.

pragmatic

Programmer
Aug 23, 2001
31
US
I'm trying to capture a phone number from the following data:

>qlrn 2485669090
Query sent: 2003/07/11 10:32:13.438 FRI.
Valid QLRN response received.
Routing number: 2485669090.
CALLING DN: 3132799933. Office: SFLDMIMKDS0.
Elapsed Time (mm:ss:mS): 0:0:80.
>

The qlrn 2485669090 is the command I send (> is the switch prompt)

What I want to strip out is the number following Routing number: (this number may change). I want to assign it to a variable to act on. I'm looking for any suggestions on how this may get accomplished.

Thanks
 
I haven't tested this, but something like this may get you started:

proc main
string sInput

if waitfor "CALLING DN"
rget sInput
endif
endproc

If the value of sInput contains the phone number (you can check using the usermsg command), then you could place the necessary command after the rget command to pull out just the phone number.


aspect@aspectscripting.com
 
This worked perfectly. I made one modification:

rget sInput 10

This eliminated my capturing the "." and cr/lf.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top