TMG-L Archives

Archiver > TMG > 2002-02 > 1013293145

From: "John Cardinal" <>
Subject: RE: [TMG] Index Codes
Date: Sat, 9 Feb 2002 17:19:20 -0500
In-Reply-To: <>

Lee Hoffman wrote:
> Cheri Casper wrote:
> >If Linda's question has validity and you need to identify which portion of
> >the index you want an entry placed, how do I search for INDEX codes in memo
> >fields where I did not put "people" or "place?" I did this eons ago and
> >just in the past few days have seen posts relating to this issue. Gees, I
> >hope I don't have to look through a few thousand people searching for these
> >random index codes scattered in memo fields. Just goes to show that a
> >little knowledge can be a dangerous thing -- I knew enough to put Index
> >codes there, but not enough to identify "which" index! <vbg>
> You could create a List of Events report looking for "[INDEX:]" in the Memo
> field. Possibly the List of People report may allow this and you can set
> the Picklist of a Flag to allow you to quickly go from one to another.
> Failing this, I expect that John Cardinal's TMG Utility can do it for you.

Cheri (and Lee),

Terry Reigel already replied about using the CRW to find the INDEX codes. It is
possible to find them with my utility, also, but more importantly, the utility
can help change them to match the proper data format, too.

For example, let's say that you entered a bunch of entries that you want in the
"People" index, but you entered them in the format implied by the example below:

[INDEX:]Wm. Smith[:INDEX]

The Find and Replace feature in my utility could be used to change them to:


Here's the basics:

Feature: Other > Find and Replace
Field to change: Event Memo (if that is where the present codes are)
Find what: "\[INDEX:\](.+) (.+)\[:INDEX\]"
Replace with: "[INDEX:]People:$2:$1[:INDEX]"
In: <all event types> (or specific events, if necessary; you decide)
[ ] Contents must match Find What exactly (unchecked)
[X] Use Pattern Matching (checked)
[ ] Match Case (unchecked)

are there to show you that there are no leading or trailing spaces. There is
only one space, actually, and it is between the parens near the middle of the
_Find what_ text: ") (".

This is a relatively complex use of Find and Replace. We are using it to replace
and rearrange existing text. The _Find what_ text says "Find two strings
following "[INDEX:]". The first string ends at the first space, and the second
string ends at "[:INDEX]". The _Replace with_ text is a mix of literals and text
found above:

- "[INDEX:]People:" is a literal
- $2 is a variable that has the value of the second string described above
- ":" is a literal
- $1 is a variable that has the value of the first string described above
- "[:INDEX]" is a literal

The net affect is to add the "People:" string and reverse the order of the given
name and surname. It won't handle cases where the given name includes a space.
That could probably be fixed, but it would make everybody's head hurt. If you
review the log, you can change those manually.

You could then use the utility to change "Wm." to "William", but you may not
want to do that. Let me know if you do.

John Cardinal's companion programs for TMG were not written
by Wholly Genes Software, the authors and publishers of TMG.
I am not an employee of Wholly Genes, though I am a WGA:
Wholly Genes Ambassador.

You can download TMG Utility from:

This thread: