I had to do this once for a data file of over 700k records.  The data import 
someone else had done hadn't worked as they had planned and some phone 
numbers had wound up inside the "Name" field.  Obviously these needed 
shifting back to the correct "Phone" field.  Easiest and quickest way to 
find these records was just to check each piece of the string by breaking it 
up.  I put all of this in a scan loop to do it back then.

A bit simple - but effective :-)

ln_startpos = 1

FOR i = 1 to LEN(ALLTRIM(thestring))
    lc_check = SUBSTR(thestring, ln_startpos,1)
    IF isdigit(lc_check)
        DO theroutineyouwannado
    ENDIF
    ln_startpos = ln_startpos + 1
ENFOR

Hope it helps,

Tina
www.datahouse.com.au



----- Original Message ----- 
From: "Richard Kaye" <rk...@artfact.com>
To: <profox@leafe.com>
Sent: Thursday, September 03, 2009 7:45 AM
Subject: RE: How to detect if digits in phone field?


Still sounds like a job for regex to me... That's way more flexible (and 
complicated) than using chrtran.

rk

-----Original Message-----
From: profoxtech-boun...@leafe.com [mailto:profoxtech-boun...@leafe.com] On 
Behalf Of MB Software Solutions, LLC
Sent: Wednesday, September 02, 2009 4:12 PM
To: profoxt...@leafe.com
Subject: Re: How to detect if digits in phone field?

Stephen Russell wrote:
> Don't we all hate to fix data entry screw ups.
>
> I guess you have to define what a valid sequence for a Phone # is.
>
> (999) 999-9999
> (999)999-9999
> 999.999-9999
> Any of the above with" ext." + 99999 and any variety of extension as well.
>
> Could you just suck out the non # values and count to see what you are
> left with?
>
> if len = 10 your ok
>
> if len = 7 your ok
>
> if len = 11 did they put in 1800
> or is anything past 10 the extention?
>
>
> Way to much fun here!
>
>


Trying to account for all the varieties they'd enter it?  NFW!

-- 
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/e8d68d1d924d4b3381e3e6fa3de32...@tinapc
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to