Upd Sometable set PhNo = ((Sget(PhNo,((sloc(PhNo,'-')) - 1), 1)) + 
(Sget(PhNo,((Slen(PhNo))-(sloc(PhNo,'-'))),((sloc(PhNo,'-'))+ 1)))) where PhNo cont '-'


----- Original Message ----- 
From: "Troy Sosamon" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 9:40 AM
Subject: [RBASE-L] - RE: SRPL


> After looking at the data closer, I think this will work as long as I check
> the 4th char is a dash.  About 90% of the numbers are 123-4567 and the other
> 10% are 1234567.
> I can do this with 2 selects.  One select where (sget(ph_num,1,4)) = '-' and
> using the sget method and one select pulling the # straight where <> '-'
> 
> Thanks for the help,
> 
> Troy
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ramsour
> Mike
> Sent: Friday, June 20, 2003 8:22 AM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - RE: SRPL
> 
> 
> Troy:
> 
> Maybe you've thought of this already but just in case . . . Have you tried
> using the SGET function?  If the numbers are all formatted the same or with
> just a few variations you could do
> 
> SET VAR vphone TEXT = '123-4567'
> --
> SET VAR vnew_phone TEXT = (SGET(.vphone,3,1) + SGET(.vphone,4,5))
> --
> SHOW VAR v%phone
> --
> RETURN
> 
> You may need a couple of variations on this or first test for the existence
> of a dash using the SLOC function.  Another option that just occurred to me
> would be to load the data into an Excel file and use its REPLACE function.
> You can use it to strip out characters.  Hope that helps.
> 
> Mike Ramsour
> Voice 740-829-4340
> 
> -----Original Message-----
> From: Troy Sosamon [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 20, 2003 10:14 AM
> To: [EMAIL PROTECTED]
> Subject: [RBASE-L] - SRPL
> 
> 
> 
> 
> 
> 
> Has anyone figured out how to use SRPL to not only remove a character, but
> the spact too.
> I need a function that will strip the dashes out of phone numbers.
> 
> 123-4567 needs to come back 1234567.
> 
> I can loop through and process on character at a time, but I would really
> like to be able to get the results in a select w/o having to do that.
> 
> Thanks,
> 
> Troy
> 
> 

Reply via email to