Troy
Using the UPDATE command with the SGET function add a WHERE colname CONTAINS
(CHAR(45))
UPDATE tableName +
SET colname = ((SGET(colname,3,1)) + (SGET(colname,4,4))) +
WHE colname CONTAINS (CHAR(45))
Buddy
-----Original Message-----
From: Troy Sosamon [mailto:[EMAIL PROTECTED]
Sent: Friday, June 20, 2003 10:29 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: SRPL
The problem is they are not all the same.
Some look like 123-4567, some are 1234567, and who know what other
variations of junk.
I was thinking about trying to nest the sloc function and use the sget to
make it work.
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