Data Cleansing

Former Member
Former Member $organization

Hi,

We're looking at integrating SMS and wondered whether anyone has any experience of data cleansing telephone numbers? Transferring from Phone 1 or 2 to a Mobile field, removing spaces and non-numerical characters.

Does anyone use a stored procedure for this or achieve it by any other means?

Thanks,
Caspian 

Parents
  • Former Member
    Former Member $organization
    Thanks!


    On 1 July 2014 16:33, Travis Armbuster <bounce-travisarmbuster9061@tessituranetwork.com> wrote:

    That works too!  :)

    From: Ryan Creps <bounce-ryancreps9649@tessituranetwork.com>
    Sent: 7/1/2014 10:16:26 AM

    There’s also a standard scalar function FS_REMOVE_NON_ALPHANUMERICS or FS_REMOVE_NON_NUMERICS, which will do this for you.

     

    Sample:

    select top 100

           phone,

           phone_clean = dbo.FS_REMOVE_NON_NUMERICS(phone)

    from   dbo.T_PHONE

     

    =>Ryan Creps

    @Tessitura Network

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Travis Armbuster
    Sent: Tuesday, July 1, 2014 11:00 AM
    To: Ryan Creps
    Subject: Re: [Tessitura Technical Forum] Data Cleansing

     

    Give this a shot and see if this will help you out with stripping the non- numeric numbers.

    /*******************************

    example

    **********************************/

    declare @phone table(
    phone Varchar(25)
    )

    insert into @phone values('1///(202)##600-4165Home',null)

    declare @strphone varchar(max)
    set @strphone = (select phone from @phone)

    BEGIN
        WHILE PATINDEX('%[^0-9]%', @strphone) > 0
        BEGIN
            SET @strphone =  stuff(@strphone,PATINDEX('%[^0-9]%',@strphone),1,'')
        END
       select (select phone from @phone) as Orginal_Phone, @strphone as clean_phone
    end

     

    If this is the result you are looking for, you could create a function the strip all the non-numeric numbers.

    example:

     

    /**********************************************************************************
    Function CleanUpPhones
    **********************************************************************************/

    CREATE Function [LFT_CleanUpPhones](@strphone VARCHAR(1000))
    RETURNS VARCHAR(1000)
    AS
    BEGIN
        WHILE PATINDEX('%[^0-9]%', @strphone) > 0
        BEGIN
            SET @strphone =  stuff(@strphone,PATINDEX('%[^0-9]%',@strphone),1,'')
        END
      RETURN @strphone
    end

    GO

    Grant select on [dbo].[LFT_CleanUpPhones] to impusers

    go

    Hope it helps.

     

    Travis

     

     

    From: Caspian Turner <bounce-caspianturner9368@tessituranetwork.com>
    Sent: 7/1/2014 6:41:00 AM

    Hi,

    We're looking at integrating SMS and wondered whether anyone has any experience of data cleansing telephone numbers? Transferring from Phone 1 or 2 to a Mobile field, removing spaces and non-numerical characters.

    Does anyone use a stored procedure for this or achieve it by any other means?

    Thanks,
    Caspian 




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!



    --
    View this message online at http://www.tessituranetwork.com/Community/forums/p/11818/36540.aspx#36540 or reply to this message

    Caspian Turner

    Web Project Coordinator

    Glyndebourne Productions Ltd

    Tel: +44 (0)1273 812321 ext. 2244

    http://glyndebourne.com


    Please don't print this email unless you really need to.

     
    Glyndebourne Productions Ltd is a charity, registered number 243877
     
    Glyndebourne Productions Ltd is a limited company registered in England and Wales.
    Registered number: 00358266. Registered office: Glyndebourne, LEWES, East Sussex BN8 5UU
     
    Please note that Glyndebourne Productions Ltd may monitor email traffic data and also the content of email for the purposes of security and staff training
     
    This message contains confidential information and is for the intended recipients only. If you are not an intended recipient you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.
Reply
  • Former Member
    Former Member $organization
    Thanks!


    On 1 July 2014 16:33, Travis Armbuster <bounce-travisarmbuster9061@tessituranetwork.com> wrote:

    That works too!  :)

    From: Ryan Creps <bounce-ryancreps9649@tessituranetwork.com>
    Sent: 7/1/2014 10:16:26 AM

    There’s also a standard scalar function FS_REMOVE_NON_ALPHANUMERICS or FS_REMOVE_NON_NUMERICS, which will do this for you.

     

    Sample:

    select top 100

           phone,

           phone_clean = dbo.FS_REMOVE_NON_NUMERICS(phone)

    from   dbo.T_PHONE

     

    =>Ryan Creps

    @Tessitura Network

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Travis Armbuster
    Sent: Tuesday, July 1, 2014 11:00 AM
    To: Ryan Creps
    Subject: Re: [Tessitura Technical Forum] Data Cleansing

     

    Give this a shot and see if this will help you out with stripping the non- numeric numbers.

    /*******************************

    example

    **********************************/

    declare @phone table(
    phone Varchar(25)
    )

    insert into @phone values('1///(202)##600-4165Home',null)

    declare @strphone varchar(max)
    set @strphone = (select phone from @phone)

    BEGIN
        WHILE PATINDEX('%[^0-9]%', @strphone) > 0
        BEGIN
            SET @strphone =  stuff(@strphone,PATINDEX('%[^0-9]%',@strphone),1,'')
        END
       select (select phone from @phone) as Orginal_Phone, @strphone as clean_phone
    end

     

    If this is the result you are looking for, you could create a function the strip all the non-numeric numbers.

    example:

     

    /**********************************************************************************
    Function CleanUpPhones
    **********************************************************************************/

    CREATE Function [LFT_CleanUpPhones](@strphone VARCHAR(1000))
    RETURNS VARCHAR(1000)
    AS
    BEGIN
        WHILE PATINDEX('%[^0-9]%', @strphone) > 0
        BEGIN
            SET @strphone =  stuff(@strphone,PATINDEX('%[^0-9]%',@strphone),1,'')
        END
      RETURN @strphone
    end

    GO

    Grant select on [dbo].[LFT_CleanUpPhones] to impusers

    go

    Hope it helps.

     

    Travis

     

     

    From: Caspian Turner <bounce-caspianturner9368@tessituranetwork.com>
    Sent: 7/1/2014 6:41:00 AM

    Hi,

    We're looking at integrating SMS and wondered whether anyone has any experience of data cleansing telephone numbers? Transferring from Phone 1 or 2 to a Mobile field, removing spaces and non-numerical characters.

    Does anyone use a stored procedure for this or achieve it by any other means?

    Thanks,
    Caspian 




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!



    --
    View this message online at http://www.tessituranetwork.com/Community/forums/p/11818/36540.aspx#36540 or reply to this message

    Caspian Turner

    Web Project Coordinator

    Glyndebourne Productions Ltd

    Tel: +44 (0)1273 812321 ext. 2244

    http://glyndebourne.com


    Please don't print this email unless you really need to.

     
    Glyndebourne Productions Ltd is a charity, registered number 243877
     
    Glyndebourne Productions Ltd is a limited company registered in England and Wales.
    Registered number: 00358266. Registered office: Glyndebourne, LEWES, East Sussex BN8 5UU
     
    Please note that Glyndebourne Productions Ltd may monitor email traffic data and also the content of email for the purposes of security and staff training
     
    This message contains confidential information and is for the intended recipients only. If you are not an intended recipient you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.
Children
No Data