Since you're apparently looking for the last occurrence of "(", I'd use:
Let ( [
textString = GetValue ( not_text_raw ; 4 )
Position ( textString ; "(" ; Length ( textString ) ; -1 )
When you use a negative value for the occurrence, it starts from the right side of the string and counts backward. Greatly simplifies hunting for something further down the road.
is there anything besides the parentheses that would identify the occurrence that you are wanting to parse?
If so, this function will work with unique identifiers ...
I'm still lost... the position calc you suggest works great for identifying the "start" for the ParseBetween calc. But I'm still having an issue returning the text I'm trying to parse. I've tried several variations, with an example of how I incorporated your idea below:
Let ( [
textString = GetValue ( raw_text ; 4 )
ParseBetween ( textString ; Position ( textString ; "(" ; Length ( textString ) ; -1 ) ; ")" )
I also tried:
Let ( [
textString = GetValue ( raw_text ; 4 );
start = Position ( textString ; "(" ; Length ( textString ) ; -1 );
end = ")"
ParseBetween ( textString ; start ; end )
Any idea on what I'm doing wrong?
I've attached a sample file to show what happens with what I believe to be the correct formula. It contains Brian Dunning's ParseBetween custom function.
The results I'm wanting to appear in the "parse text" field is " a sample "
test parse.fmp12.zip 68.1 K
Awesome! I adapted and consolidated into my solution for just the one destination field. Thank YOU!
[ source = GetValue ( raw_text ; 4 ) ;
start = Position ( source ; "(" ; Length ( source ) ; -1 ) ;
lastchunk = Middle ( source ; start ; Length ( source ) ) ] ;
ParseBetween ( lastchunk ; "(" ; ")" ) )