Neuronal Nerd Posted August 12, 2010 Posted August 12, 2010 (edited) 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, 2010 by Guest
comment Posted August 12, 2010 Posted August 12, 2010 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.
Neuronal Nerd Posted August 12, 2010 Author Posted August 12, 2010 (edited) 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, 2010 by Guest
comment Posted August 12, 2010 Posted August 12, 2010 A period does not necessarily signify the end of a sentence (e.g. 0.54) and vice versa - see?
Neuronal Nerd Posted August 12, 2010 Author Posted August 12, 2010 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.
Lee Smith Posted August 12, 2010 Posted August 12, 2010 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
Recommended Posts
This topic is 5555 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now