* Search and Replace plugin update

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Search and Replace plugin update

Post by tatewise »

There have been issues for some time regarding replacement of Place names.
I suddenly realised that search & replace of Place record names before all other records usually solves the global change problem because then all links to Place records get automatically updated before the search gets there.
If more selective replacements are required then more selective techniques will need to be used by the user.
BTW: The Edit > Find and Replace... command suffers the same symptoms of creating a new blank Place record because the default record search order puts Place records nearly last so all the links get changed first. :roll:

The new issue with rich text fields holding record links is not helped by the poor plugin support for such links.
For the technically minded, text replacements are usually performed using string.gsub() but rich text fields are not strings but complex user data so must be converted to plain text, which has the side effect of destroying the record links.
I have had to resort to reading the rich text subsidiary tags _LINK_I, _LINK_F, etc, and _LKID beforehand and recreating them after the string replacements. That technique probably needs to be a KB code snippet.

The attached Search and Replace plugin Version 3.1.1 Date 20 Dec 2020 should resolve the above issues.
Please feel free to try and break it :D
Last edited by tatewise on 20 Aug 2021 10:00, edited 1 time in total.
Reason: Attachment deleted as later version is in the Plugin Store.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
David Potter
Megastar
Posts: 1010
Joined: 22 Jun 2016 15:54
Family Historian: V7
Location: United Kingdom

Re: Search and Replace plugin update

Post by David Potter »

Thank you Mike, Testing it now.

David
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace plugin update

Post by tatewise »

David has posted on the FH Email list "Tested and looks perfect as far as I can see."

So Search and Replace plugin Version 3.2 Date 21 Dec 2020 is now in the Plugin Store.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
E Wilcock
Megastar
Posts: 1181
Joined: 11 Oct 2014 07:59
Family Historian: V7
Location: London
Contact:

Re: Search and Replace plugin update

Post by E Wilcock »

I tested it. Very beautiful Mike, Thank you.
Someone posted this morning about setting special keys to enter a Census date.
To save time, I have often used year only dates for census and then used your plug to search and replace to enter a full census date. Confirming each time
Today it worked very fast but maybe that is due to a powerful new computer and I used to run it on a small old computer

I am not sure how to test it to destruction? If it searches correctly for text fields in a text document, surely it will always. I just replaced Wurzburg with Würzburg throughout.
I am lazy about data entry and work fast, then use this plug in to add any troublesome details.
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace plugin update

Post by tatewise »

You have hit the nail on the head!
If only it were as simple as searching "correctly for text fields in a text document".
Firstly, it is a structured database rather than a simple text document.
Secondly, there is now word-processing style rich text notes to deal with.
Thirdly, the plugin offers pattern-matching options for advanced users.
Fourthly, ... I'm sure there must be a fourthly ... :D
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply