Change Place Parts

TMG Utility is the essential TMG companion tool. If you use it, please make a donation.

advertisement

On this page: Description, Step by Step, Filters, Actions, User Variables, Field Labels, Rule Files, Example Rule Files

Description

Change Place Parts will change place parts (detail, city, county, state, etc.) under the control of one or more filters and one or more actions.

Filters determine which places are changed. If more than one filter is supplied, the filters are anded together, meaning that the name must pass all the filters in order to be changed. The available filters support testing place part contents as well as the place style.

Actions determine how the places are changed. The available actions support adding or deleting prefixes, adding or deleting suffixes, setting the entire contents of a place part, or changing the place style.

Both filters and actions use the standard place part labels.

Step by Step

  1. Choose Change Place Parts under Places in the function tree.
  2. Specify the filters and actions by clicking [Set Rules...] to open the Rules Editor.
  3. Set the Match case checkbox if you want the filter terms to be case sensitive. When Match case is checked, "MIXED" does not equal "Mixed". When Match case is not checked, they are equal. The default is unchecked.
  4. Set the Show All Place Fields checkbox if you want the log to show all the name fields in sequence rather than using the associated Place Style to format the log entry. This is useful if you are changing one or more subfields that do not display such as the SortGiven or SortSurname fields.
  5. Click the [Change Place Parts] button.
  6. TMG Utility will prompt for the literal values if the rule set includes user variables.

Filters

Data Operators Values
Any Place Part
Addressee
Detail
City
County
State
Country
Postal
Phone
LatLong
Temple
Comment
equal to
not equal to
starts with
contains
ends with
A sequence of one or more characters.

You can enter user variables and field labels in this value.

The filters above test the contents of a specific part or all parts.

Any Place Part
Addressee
Detail
City
County
State
Country
Postal
Phone
LatLong
Temple
Comment
like A "regular expression".

The like filter tests the contents of a specific part or all parts.

Regular expressions are a powerful matching facility that allow you to search for patterns of text rather than for literal text values. If you are not familiar with regular expressions, you may want to consider them as a means to add wildcard characters to the target. Regular expressions are described for the Find and Replace feature.

Any Place Part
Addressee
Detail
City
County
State
Country
Postal
Phone
LatLong
Temple
Comment
is empty
is not empty
<not applicable>

The filters above test whether a field is empty or not empty.

Place Style equal to
not equal
A place style from the list.
The filters above test the style assigned to the place.
Start Year
End Year
equal to
not equal
is less than
is less than
  or equal to
is greater than
is greater than
  or equal to
A year number
The filters above test the start and end years assigned to the place.

The sequence of filters is important only in that the processing will be faster if the most restrictive filters are at the top of the list.

Actions

Data Operators Values
Addressee
Detail
City
County
State
Country
Postal
Phone
LatLong
Temple
Comment
prepend
delete prefix
set to
append
delete suffix

A sequence of zero or more characters for set to, or a sequence of one or more characters for the other operators.

You can enter user variables and field labels in this value.

The actions above modify the contents of a specific part.

To move data from one part to another, first use an action that copies the value to the new part, then use an action that deletes the value from its original location.

Addressee
Detail
City
County
State
Country
Postal
Phone
LatLong
Temple
Comment
replace A target value in the first textbox and a replacement value in the second textbox.

The replace action provides a relatively simple find and replace operation for a specific place part.

The target value will be replaced by the replacement value.

Addressee
Detail
City
County
State
Country
Postal
Phone
LatLong
Temple
Comment
replace pattern A target value in the first textbox and a replacement value in the second textbox.

The replace pattern action provides a powerful find and replace operation for a specific place part.

The target value selects text that will be replaced by the replacement value. The target value is a regular expression.

Regular expressions are a powerful matching facility that allow you to search for patterns of text rather than for literal text values. If you are not familiar with regular expressions, you may want to consider them as a means to add wildcard characters to the target. Regular expressions are described for the Find and Replace feature.

The syntax for user variables conflicts with some regular expressions. You will have difficulty if you try to use a character class expression that begins with "v", as in "[v ...]". Put the "v" elsewhere in the character class to avoid the conflict.

Addressee
Detail
City
County
State
Country
Postal
Phone
LatLong
Temple
Comment
copy A part from the list.
The copy action copies the contents of one part to another part.
Place Style set to
A style from the list.
The set to action changes the name style assigned to the name.
Start Year
End Year
set to
A year number.
The set to operation sets the Start Year or End Year value.

You can combine actions to change multiple parts, etc. The sequence of actions is important only if you perform two or more actions on the same part.

User Variables

Variables allow the creation of general purpose rules; the value of a variable is set via a prompt when you click the [Change Place Parts] button, not when you define the rules. You can include variables in any literal text field used by filters or actions.

User variables work the same way in all of the "Change <something> Parts" features including Change Place Parts, Change Citation Parts, and Change Name Parts. See the description on the Change Name Parts page.

Field Labels

You can reference the value of another field via a Field Label in any literal text value used by filters or actions. Field Label references support the creation of general purpose rules.

The Change Place Parts feature supports the following Field Labels only. If you use custom styles or country-specific versions of TMG that do not use the following labels by default, choose a Field Label from the list below based on the sequence # that matches your Field Label.

Number Field Label
1[ADDRESSEE]
2[DETAIL]
3[CITY]
4[COUNTY]
5[STATE]
6[COUNTRY]
7[POSTAL]
8[PHONE]
9[LATLONG]
10[TEMPLE]
[COMMENT]
[SY] (Start Year)
[EY] (End Year)

Rule Files (.u5rp)

You can save and load rule files using the Rules Editor. The ".u5rp" files look like text files, but they include invisible characters embedded in the text. Don't change them with a text editor such as Notepad or TextPad. Change them using the Rules Editor.

Example Rule Files

There are a few example rule files in the Rules folder supplied with TMG Utility that demonstrate the feature and actually produce results you might want.

Change Co to County.u5rp
Changes " Co." to " County" when it occurs at the end of the County field.