QTP Code to strip out a phone number?
Ken Langendock
Ken at Langendock.com
Wed Feb 13 14:33:28 CST 2008
Thanks everyone, I just created a String parser to deal with this...not the
most elegant, but it should work.
Ken
_____
From: powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com
[mailto:powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com] On
Behalf Of Nalder, Jay
Sent: February 13, 2008 3:02 PM
To: powerh-l at lists.sowder.com
Subject: RE: QTP Code to strip out a phone number?
Will this get you started?
define phone-digits char*10 = no-phone if matchpattern(no-phone,
"##########") else &
no-phone[02:3] + &
no-phone[06:3] + &
no-phone[10:4] if matchpattern(no-phone,
"(###)###-####") else &
no-phone[01:3] + &
no-phone[05:3] + &
no-phone[09:4] if matchpattern(no-phone,
"###-###-####") else &
no-phone[01:3] + &
no-phone[05:3] + &
no-phone[09:4] if matchpattern(no-phone,
"###.###.####")
define phone-num int*8 = nconvert(phone-digits)
in this example [no-phone] is a character field of suitable length.
If you have other formats that you want to catch, then you could add more
cases to the define.
It may not be the most efficient, but on the other hand, I believe that it
is easy to read,
Jay Nalder.
From: powerh-l-bounces+jnalder=ascprofiles.com at lists.sowder.com
[mailto:powerh-l-bounces+jnalder=ascprofiles.com at lists.sowder.com] On Behalf
Of Johnson, Tracy
Sent: Wednesday, February 13, 2008 11:43 AM
To: Ken Langendock; powerh-l at lists.sowder.com
Subject: RE: QTP Code to strip out a phone number?
Isn't there an example of this using Soundex in the old 5.01 manuals?
_____
From: powerh-l-bounces+tracy.johnson=meas-spec.com at lists.sowder.com
[mailto:powerh-l-bounces+tracy.johnson=meas-spec.com at lists.sowder.com] On
Behalf Of Ken Langendock
Sent: Wednesday, February 13, 2008 2:02 PM
To: powerh-l at lists.sowder.com
Subject: QTP Code to strip out a phone number?
Hello all, Anyone created a routine to strip out a phone number from a
string already?
(555) 432-0434 to 5554320434
or
555-432-0434
or
555.432.0434
or any other layout that might be input?
Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20080213/84ddcd7e/attachment.htm
More information about the powerh-l
mailing list