Search and Replace ~ Usage Examples

Date Error Correction

In the Search box enter the invalid Date value, such as 31 June.

In the Replace box enter the replacement value, such as 30 June or 31 July.

With Date fields all words are spelled out in full such as January, December, estimated, calculated, circa, before, after, and between.

Ensure the Plain Text Mode and Case Insensitive and Whole Words modes are selected.

To search only Date fields, clear all Basic Filters except Date fields, or on Extra Filters tab use Exclude All Short Text and Exclude All Long Text to leave just Date fields ticked.

Click the Search & Replace button, then in each Confirmation prompt, either approve the change by clicking the Replace button, or inhibit the change by clicking the Skip button. You can adjust the change by typing into the Replacement Value box.

Return to top.

Missing Occupation Values

To find any missing field values, clear the Search box.

If they all need replacing with the same value, then enter that in the Replace box, otherwise leave it empty.

Select the Extra Filters tab, use Exclude All Short Text and Exclude All Long Text, and clear all the Distinctive Fields.

Tick Fact Attribute values and select Occupation (INDI.OCCU) from its drop-down list.

Click the Search & Replace button, then in each Confirmation prompt:

  • Ensure the desired Occupation is entered in the Replacement Value box and click the Replace button.
  • To terminate the search before all fields have been processed, click the Cancel button.

When complete, the changed Occupations will be listed in the Result Set.

If any are incorrect, then double-click on its New Value box and update via the Property Box.

To reverse all the changes use Edit > Undo Plugin Updates.

Return to top.

Place Name Changes in FH V6

The FH V6 Place Records pose extra challenges when changing Place names.

Global Change Example

The objective is to make global changes to existing Place names, but without altering the links between PLACe fields and _PLACe records, and retaining all _PLACe record details such as Lat/Longitude, Notes, Media, etc.

In the Major Options tab set Search Scope: Place Records (_PLAC) and tick Place fields but clear all other Basic Filters. The Whole/Part Words option may need changing. Enter the Search and Replace change required and click the Search & Replace button. This technique should never create residual unused _PLACe records with 0 links.

Selective Change Example

The objective is to make selective changes to some Place names, and for new PLACe field values to create new blank _PLACe records, but leave all other PLACe fields and _PLACe records unaltered.

Method A

Leave Search Scope: All Records & Events/Attributes and tick Place fields but clear all other Basic Filters. Enter the Search and Replace change required and click Search & Replace button. BUT, when the Data Reference in replacement dialogue reaches the first _PLAC Record Id: [*] Data Ref: _PLAC.TEXT click Cancel to prevent altering any existing _PLACe records. The snag is Confirm every item found must be tediously stepped through to the first _PLACe record, but if the changes are selective you will probably need to Confirm every item found anyway.

Method B

Set Search Scope: Individual Records (INDI) to narrow the selection, and tick Place fields but clear all other Basic Filters. Enter the Search and Replace change required and click Search & Replace button. Then repeat with Search Scope: Family Records (FAM) and rarely Search Scope: Source Records (SOUR) until all required PLACe fields are changed. This approach allows bulk changes by unticking Confirm every item found.

This technique may leave residual unused _PLACe records with 0 links, that may need to be Merged with new blank _PLACe records to migrate the details such as Lat/Longitude, Media, etc.

Return to top.

LUA Pattern Mode

See Understanding Lua Patterns for details of the formats used.

Example 1

Assume you want to find every number with a letter suffix such as 1st, 32nd, 53rd, 94th, 15Km, 39grms, 100Mb, etc.

In the Search box enter %d+%a+ which matches one or more digits followed by one or more letters.

Ensure that LUA Pattern Mode is selected, and every Filters check box is ticked.

Click the Search ONLY button and in each Confirmation prompt click the Report button.

When the search is finding what you want, clear the tick from Confirm every item found, and click the Report button again.

A Result Set of the required fields will be displayed.

Example 2

As an example, if you have accidentally entered several Date fields with years such as 9103 and 9107 instead of 1903 and 1907 then this is how to correct them.

Ensure that LUA Pattern Mode is selected.

In the Search box enter 91(%d%d) which matches 91 followed by a capture of any two digits.

In the Replace box enter 19%1 which substitutes 19 followed by the captured two digits.

Select and process the Date fields as described in the Date Error Correction example above.

You may need to experiment with the Search and Replace text until you achieve the desired changes.

While experimenting it is advisable to use the Skip button and Cancel button, which will return to the Major Options tab to facilitate altering the Search and Replace text until correct.

Return to top.


Return to Search and Replace Plugin Introduction.

CC Attribution-Noncommercial-Share Alike 4.0 International
Runs using DokuWiki Recent changes RSS feed www.rjt.org.uk