* Search and Replace setting to change custom ID text

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
avatar
Gowermick
Megastar
Posts: 1704
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Search and Replace setting to change custom ID text

Post by Gowermick »

My custom ID's are in the form
1. Prefix letter T or J
2. 5 Digit number (padded with leading 0's
3. Followed by an indeterminate number of lower case letters
e.g T00245abcd or J00347

In an attempt to standardise them, the first step is to change all appropriate prefixes from a T to a J.

I set scope to INDI - NB Custom ID field not available as an option!
Selected All other Text field
I selected Type fields for facts & Custom id etc on Extra Filters tab
Selected LUA Pattern mode
entered T%d+ for search criteria

But when I click search ONLY, I got zero results.
Can someone explain where I'm going wrong?
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace setting to change custom ID text

Post by tatewise »

Try the next option down in the Extra Options tab: Custom Id fields
Hover on that option and the popup tooltip confirms it selects the REFN tag.

The option you chose has a popup tooltip that identifies the TYPE tag, which is very different.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Gowermick
Megastar
Posts: 1704
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Search and Replace setting to change custom ID text

Post by Gowermick »

Miketate,
Thanks, my eyesight must be getting bad, I didn’t even spot that option. :oops:

That worked, and I can now find all those with the T, but as I’m not too sure how LUA patterns work, what do I set the replace field to, so that the whole of the ID is copied with just the T being replace with a J, (keeping the rest of the ID as it was)
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace setting to change custom ID text

Post by tatewise »

OK use:
T(%d+) that captures the digits
and
J%1 that replaces T with J followed by the capture
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Gowermick
Megastar
Posts: 1704
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Search and Replace setting to change custom ID text

Post by Gowermick »

Got it!
My mistake! i was searching for T%d+, and writing J%1, which gave TJxxxx, when i wanted Jxxxxx.
I realised I should have been searching for T(%d+), which then gave me Jxxxxx, just what I wanted!

Thanks for the plugin Mike
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
User avatar
tatewise
Megastar
Posts: 28414
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace setting to change custom ID text

Post by tatewise »

Yes, if there is no specified capture in ( parentheses ) then the whole match is the 1st capture.
So T%d+ is matched & captured and then J%1 will replace it with JTxxxx

BTW: If there are multiple ( parentheses ) captures then the 1st is %1, the 2nd is %2, and so on...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Gowermick
Megastar
Posts: 1704
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Search and Replace setting to change custom ID text

Post by Gowermick »

Thanks Mike, it worked a treat.
It prompted me to sort out my files, many of which also contained the custom ID as an identifier within the file name.

I went back to good old MS-DOS, and used a similar technique using the REN(ame) command in the command line window
i.e. REN T*.* J*.*

It had been on my todo list for a while now, and kept putting it off, but it’s now nearly complete.
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Post Reply