Page 1 of 1
Search and Replace setting to change custom ID text
Posted: 21 Jul 2022 11:42
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?
Re: Search and Replace setting to change custom ID text
Posted: 21 Jul 2022 13:35
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.
Re: Search and Replace setting to change custom ID text
Posted: 21 Jul 2022 15:00
by Gowermick
Miketate,
Thanks, my eyesight must be getting bad, I didn’t even spot that option.
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)
Re: Search and Replace setting to change custom ID text
Posted: 21 Jul 2022 15:02
by tatewise
OK use:
T(%d+) that captures the digits
and
J%1 that replaces T with J followed by the capture
Re: Search and Replace setting to change custom ID text
Posted: 21 Jul 2022 15:16
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
Re: Search and Replace setting to change custom ID text
Posted: 22 Jul 2022 09:08
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...
Re: Search and Replace setting to change custom ID text
Posted: 22 Jul 2022 09:50
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.