1 Reply Latest reply on Feb 21, 2010 9:51 AM by comment_1

    Text Parsing Challenge

    deadboltsecurity

      Title

      Text Parsing Challenge

      Post

      OK, this question probably shows how much of newbie I am as it seems like a pretty basic challenge.

       

      I'm importing text from a log file into a field called  "TheLine". My data looks like this...

      edit 27 here red there www

      edit 149 here green brown blue there eee

      edit 217 here blue there 888-999

      edit 22 here yellow-orange there

      edit 43 here there 

       I'm trying to make a formula field called "TheResult" that has all the text inbetween "here" and "there". I should wind up with...

      red

      green brown blue

      blue

      yellow-orange

      {empty field}

       I've got so many nested MiddleWord, Position, Left, Right, RightWords, etc. that I've totally blown my last brain cell.

       

      Help! (Next I get to figure out how to properly sort IP addresses. That should be fun!)

       

      TIA

       

       Kevin

       

        • 1. Re: Text Parsing Challenge
          comment_1
            

          Kevin Ericson wrote:
          I'm trying to make a formula field called "TheResult" that has all the text inbetween "here" and "there".

          Try:

           

          Let ( [
          start = Position ( TheLine ; "here" ; 1 ; 1 ) + 4 ;
          end = Position ( TheLine ; "there" ; start ; 1 )
          ] ;
          Middle ( TheLine ; start ; end - start )
          )