Set Person Field

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

advertisement

On this page: Description, Step by Step Instructions (Set Field from File, Set Field to Literal, Clear Field, LowerCase Field, UpperCase Field), Why Does This Feature Exist?, Data File Format

Description

The Set Person Field panel supports multiple functions. All of them change the value of a field in the "person" table. All of the functions are not available for all the fields in the Field to change pull-down menu.

Set Field from File changes the value for a subset of people. The function requires an external data file in a particular format that is described below.

The following fields may be set: Reference, Last Edit Date, Gender, Living Flag, BirthOrder, MultiBirth, or any custom flag.

Set Field to Literal sets the the value of a field to a user-specified value.

Clear Field sets the the value of a field to the default value.

Note that Set Field to Literal and Clear Field set the value for all people in the database, whereas Set Field from File changes it for a particular subset based on the input file.

LowerCase Field changes the alphabetic characters in a field to lowercase characters.

UpperCase Field changes the alphabetic characters in a field to uppercase characters.

Step by Step - Set Field from File

  1. Create a data file in the format described below.
  2. Choose Set Person Field from the function tree.
  3. Select the field you want to change from the Field to change pull-down menu.
  4. Check or Uncheck Input values are quoted as desired.

    If the values in the text file are quoted, and the quotes are not part of the data, make sure this box is checked.

  5. Click the [Set Field from File...] button.
  6. Choose the input file using the standard file dialog and click the [OK] button.

Step by Step - Set Field to Literal:

  1. Choose Set Person Field from the function tree.
  2. Select the field you want to change from the Field to change pull-down menu.
  3. Click the [Set Field to Literal...] button.
  4. An input dialog appears. Key the value (the literal) that should be assigned to the field.
  5. Click the [OK] button to close the input dialog and start the assignment process.

Step by Step - Clear Field:

  1. Choose Set Person Field from the function tree.
  2. Select the field you want to change from the Field to change pull-down menu.
  3. Click the [Clear Field...] button.
  4. Click the [OK] button in the confirmation dialog.

Step by Step - LowerCase Field:

  1. Choose Set Person Field from the function tree.
  2. Select the field you want to change from the Field to change pull-down menu.
  3. Click the [LowerCase Field...] button.
  4. Click the [OK] button in the confirmation dialog.

Step by Step - UpperCase Field:

  1. Choose Set Person Field from the function tree.
  2. Select the field you want to change from the Field to change pull-down menu.
  3. Click the [UpperCase Field...] button.
  4. Click the [OK] button in the confirmation dialog.

Why Does This Feature Exist?

The Set Field from File feature was created primarily to allow making bulk edits to the Reference field. I added the capability to modify other fields because the technique seemed valid in certain cases, such as the Last Edited Date.

In the case of flag fields, TMG will modify them using the Report Writer, but this feature has two limitations:

  1. The modification must be made based on a List of Persons report.
  2. You must be able to specify criteria to identify the people whose flag you want to set.

In practice, those limitations are not a big problem. In certain cases, however, they make it impossible to use TMG to do bulk changes, and that leaves only one option: tedious, one-at-a-time editing.

Joe Murphy's utility program had a similar function which was in development at the time of his death. Jim Byram brought that to my attention and that was a major incentive for me to include it here--to honor his memory by completing a feature that he was unable to complete before he went on to bigger and better things.

The other two functions, Set Field to Literal and Clear Field, were added because of user requests and because they are useful complements to the main function.

LowerCase Field and UpperCase Field were added because a user needed them and they were easy additions based on the existing functions.

Data File Format

The "Set Field from File" feature requires a "tab-delimited" text file. This text file determines both who and what, where "who" is which people's values are set, and "what" is what value to assign for a particular person.

The text file can be created by hand in a text editor, or it can be created by some other program, such as TMG's own Report Writer or Microsoft Excel. A combination of methods may be required.

The tab-delimited text file has one line for each person to be updated. Each line must contain 2 data values, separated by a tab character.

id-numbervalue

In the examples above and below, takes the place of a real tab character. Tabs are not visible in web browsers, so I have replaced them with in this documentation.

The id-number must be the TMG ID number of a person that exists in the database being processed.

The value is the data to be assigned to the field chosen from the pull-down menu (see Step by Step - Setting Field Values, above).

If the text file contains more than two data values, the third and successive values are ignored. This may be useful; if you produce a data file using another program but you need to do some manual editing to create the proper field value, the third and subsequent fields can hold data that reminds you what value should be assigned.

id-numbervalueignored

Here are some correctly-formed entries:

117V17-23
98V17-11
1001SUSPECTNote to self: check this one!
435V17-101
42V18-??

Each text line begins at the left margin. If you view this page in a narrow browser window, the line may wrap. Any indented text is a continuation of the line above. Do not wrap lines when you create an actual data file. The other examples on this page follow the same convention.

Some things to note are as follows.

  1. The example assumes that 117, 98, 1001, 435, and 42 are valid TMG ID numbers.
  2. The example also assumes that the field being modified is at least 7 characters wide, as that is the length of the longest data value entries.
  3. The ID numbers do not have to be padded to a consistent length.
  4. The ID numbers to do not have to appear in sequence.
  5. The value field can contain different length data as long as it does not exceed the length of the database field being modified.
  6. Extra data fields may appear in zero, some, or all input records.

Some programs like to put quotes around data fields. This often happens in "comma-delimited" data files, but it can also be true for tab-delimited files. If you create such a file, it might look like the following:

"117""V17-23"
"98""V17-11"
"1001""SUSPECT""Note to self: check this one!"
"435""V17-101"
"42""V18-??"

The lines above are also correctly formed, provided that Input values are quoted is checked when the data file is processed.