Page 1 of 1
Help with an expression
Posted: 09 Sep 2022 20:59
by Ossey55
I am using the following expression now with my grave location project:
=ContainsText(%INDI.BURI.NOTE2%,"Section",STD)
I have found that cemeteries do not follow a standard for locations of graves. Some use Sections, Lots, Plots, and grave numbers.
My question is: How do I add more words to the above expression without getting more icons for my chart?
I want only one icon to show up after searching for the words Section, Lot, Plot, Grave in my notes field.
Thanks for any help
Jim
Re: Help with an expression
Posted: 09 Sep 2022 22:31
by Ron Melby
perhaps you create your own standard thing in the note.
Loc: grave U_14
Loc: lot 1554 section heaven
Loc: section eternity, space 15
or something
GLI: (grave location information for me) that is unlikely to show up in any other kind of note in that combination, and preface all locations with a standard aha!!!!!! gotcha fer shur!!!!!! text tag.
Re: Help with an expression
Posted: 10 Sep 2022 08:47
by tatewise
This is related to your earlier posting
Help with an expression (20871) that was also looking for a burial location.
I think Ron's suggestion may be the best solution. Otherwise, you might keep having to cope with new words.
A similar suggestion is given in FHUG Knowledge Base
Narrative Report Fact Sentence Templates under
Custom Fact Fields where it explains how to add labelled meta-fields in the Note field.
Then use
=ContainsText(%INDI.BURI.NOTE2%,"Location:",STD) or
=GetLabelledText(%INDI.BURI.NOTE2%,"Location:") to detect any burial location whether it is GPS, Section, Plot, Lot, Grave number, or anything else that may arise.
A potential snag with using
=ContainsText(...) to detect short text like
Plot and
Lot is that they are not case sensitive nor bounded words. So for those two cases
Plot would match
plotting and
Lot would match
plotting,
clothes,
slots, etc.
Re: Help with an expression
Posted: 10 Sep 2022 13:45
by Ossey55
Thank you, Ron and Mike.
I am going to use the Loc: suggestion, even though it will take a while to change them all. I have over 700 to do.
Jim
Re: Help with an expression
Posted: 10 Sep 2022 15:07
by tatewise
It might be possible to use the
Search and Replace plugin to perform the task.
Perhaps have a trial run on a COPY of your Project.
The settings shown below will insert the word
Location: before the first line in the
Burial Note only if text exists.
On the
Extra Filters tab ensure only
Note & Description fields is ticked and
Fact Notes (~Fact.NOTE) chosen.

- BurialNoteSearchAndReplace.png (50.44 KiB) Viewed 474 times
The Search:
(.+) captures the
Burial Note text but only if any exists.
The Replace:
Location: %1 inserts
Location: and the captured text.
The
Result Set lists the changes that can be quickly scanned to check the changes are OK.
If not, then selectively edit the ones that need fixing, or use
Edit > Undo Plugin Changes to undo them all.
Ask if you need further advice.
For example, if it is necessary to specifically look for GPS, or Section, or Plot, etc...