Remove a Email Address from a string

  • I'm trying to remove a email address from a string, the string looks like this:

    From:

    System Administrator

    Sent:

    Friday, 7 May 2004 8:50 AM

    To:

    testuser@iprimus.com.au

    Subject:

    Undeliverable:Mighty May Clearance!

    Your message did not reach some or all of the intended recipients.

    Subject: Mighty May Clearance!

    Sent: 4/05/2004 9:26 PM

    The following recipient(s) could not be reached:

    testuser@iprimus.com.au on 7/05/2004 8:50 AM

    The e-mail account does not exist at the organization this message was sent to.

    the only information from this string that I need is the email address.

    does anyone have some ideas how this can be done.

    Thanks

     

  • REPLACE(

    SUBSTRING(LEFT(@stringvalue,

    CHARINDEX('Subject:',@stringvalue)-1),

    CHARINDEX('To:',@stringvalue)+4,LEN(@stringvalue)),

    CHAR(13)+CHAR(10),'')

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Thanks for that.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply