Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Extract text between two strings

  1. #1
    New Member
    Join Date
    Feb 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Extract text between two strings

    Hi,

    Can someone help me?

    In column A I have some thousands of cells with lots of html text.
    In each cell along the text there's a flash embed code which I need to extract and place in the next column. The code start with "object" and ends with "/object". How do I extract only this code and paste in column B?

    THANKS for the help...

    Knokenet
    Last edited by knokenet; Feb 22nd, 2011 at 10:42 AM.

  2. #2
    Board Regular
    Join Date
    Aug 2009
    Location
    London
    Posts
    116
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extract text between two strings

    Assuming your data is in cell A1

    =MID(A1,SEARCH("object",A1)+6,SEARCH("/object",A1)-SEARCH("object",A1)+6)

    That will extract data between your 2 criteria, just drag down for the rest
    Last edited by Phanmore; Feb 22nd, 2011 at 10:50 AM. Reason: Edited along with your post

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Posts
    193
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extract text between two strings

    Use a FIND to get the digit number for both "object" and "/object". Then MID to get everything in between.

    =MID(A146,FIND("object",A146,1)+7,FIND("/object",A146,1)-FIND("object",A146,1)-8)

  4. #4
    New Member
    Join Date
    Feb 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extract text between two strings

    Thank you Phanmore! Had to play a bit with the numbers to include all the text string, but it worked!

    Thank you cjcobra, Phanmore's code was sufficient for me.

    Best,

    Knokenet

  5. #5
    New Member
    Join Date
    Jul 2015
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extract text between two strings

    Thank you cjcobra and Phanmore!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •