Calculation advice needed: Substitute and GREP-like abilities in FMP -
09-15-2005
, 09:43 AM
Hi all
I'm currently using FMP version 6.0 on a PC (got 8.0 ordered and in the
post, though), and have a calculation/scripting question I would
appreciate a head's-up on.
I'm currently using a substitute calculation to automatically parse
articles full of text and re-write them. E.g. to find instances of '£'
and replace instead with 'GBP' (or to replace '$' with 'USD').
I'm using something like this to do the job ...
Substitute (body, " GBP " , " £ ")
or
Substitute (body, " a really great " , " a decent ")
For my purposes, the articles I am parsing consist of two different
types of text. Commentary by the article writer - for which I am happy
to change the text using my substitute calculation as shown above - and
quotes by any people interviewed, where they speak, yack, comment and
talk ... and in this latter instance, I would prefer to leave their
quotes untouched by the Substitute calculation. Mainly because people
get very angry if you change anything they said.
People's comments always start/end with speech marks, either a single
', or a double " - depending on whether UK or US spelling rules are
being followed (e.g. the text might read something like ... Today Bob
Smith commented on the bombing: "I am ready shocked by the violence of
the insurgents.")
Ideally I would like to parse the article and make my substitution
rules heat-seeking, so to speak, so they apply to all of the text
EXCEPT where paragraphs of text are surrounded by speech marks - either
single ' or double ", which they should ignore.
Any ideas how to achieve this using FMP?
I am fairly sure I could do this with regular expressions and GREP
using another application, but in FMP, unless I am missing a trick,
GREP seems to be limited to the likes of ...
Substitute(Substitute(body, " GBP " , " £ "), "(R)" , "Registered
Trade Mark") ... which seems to me a bit of an omission by Filemaker.
Your ideas gratefully received.
Stephen |