August 12, 201015 yr I need help from those of you more creative than myself. Is there a way that a calculation can find every parenthetical phrase in a text field and move each one to the end of that sentence. Example Input: "The patient's score was average (i.e. Full Scale IQ = 50th percentile) on the Wechsler Scales of Adult Intelligence." Desired Output: "The patient's score was average on the Wechsler Scales of Adult Intelligence (i.e. Full Scale IQ = 50th percentile)." Thanks for your help! Edited August 12, 201015 yr by Guest
August 12, 201015 yr This would be a recursive operation and thus require either a custom function or a script. You also need to pay attention to nested/unbalanced parentheses. See here for a starting point: http://fmforums.com/forum/showpost.php?post/289685/ I am not sure what "the end of that sentence" means. If it's the end of the field, that's easy - but it's not so simple to determine the end of a sentence.
August 12, 201015 yr Author Yes, I would like to do this as a custom function. The text field will have numerous sentences, so I would like each parenthetical text moved to the end of it's respective sentence (i.e., the position just before the period where the phrase was found). Edited August 12, 201015 yr by Guest
August 12, 201015 yr A period does not necessarily signify the end of a sentence (e.g. 0.54) and vice versa - see?
August 12, 201015 yr Author Excellent point! Based on the content of the text fields I'm using this for, a period followed by a space would be a safe alternative.
August 12, 201015 yr It's unfortunate that FileMaker still hasn't provided for Regular Expressions, with the ability to use Grep Tools where you can do pattern searches and replacements, like you would find in a program such as TextWrangler or BBEdit. If this data is in text format and your are importing it, you might try a pattern search and replace such as; find: (.*)((i.e..*))(.*). replace 132. Lee
Create an account or sign in to comment