*how to remove alternate names with Clean Unwanted Fields

Writing and using plugins for Version 5 and above.
User avatar
BillH
Megastar
Posts: 1330
Joined: 31 May 2010 03:40
Family Historian: V6.2
Location: Washington State, USA

how to remove alternate names with Clean Unwanted Fields

Postby BillH » 23 Oct 2018 17:56

I am trying to remove alternate names using the Clean Unwanted Fields plugin.

I added the data reference %INDI.NAME[2]% to the data reference fields in the plugin, but when I ran the plugin it said the data reference was not used and the output file still has the alternate names in it. What am I doing wrong?

Thanks!
Bill Henshaw

User avatar
tatewise
Megastar
Posts: 14970
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: how to remove alternate names with Clean Unwanted Fields

Postby tatewise » 23 Oct 2018 19:13

You are doing nothing wrong Bill.
I just never expected that specific instances of data items would be required - Sorry :cry:
Also, it finds a flaw in the Plugin that accepts the data ref as valid, but does not then act on the [index].

Try the attached Clean Unwanted Fields Plugin Version 1.1.1 Date 23 Oct 2018 that does cater for instances.
Attachments
Clean Unwanted Fields.fh_lua
Version 1.1.1 Date 23 Oct 2018
(13.03 KiB) Downloaded 54 times
Mike Tate ~ researching the Tate and Scott family history.

User avatar
BillH
Megastar
Posts: 1330
Joined: 31 May 2010 03:40
Family Historian: V6.2
Location: Washington State, USA

Re: how to remove alternate names with Clean Unwanted Fields

Postby BillH » 23 Oct 2018 19:26

Mike,

Thanks for the quick fix. I wanted to get rid of all the alternate names and keep just the primary name. I added INDI.NAME[2] thru INDI.NAME[10] which would cover the most alternate names any individual had. This new version of the plugin worked great.

Thanks!
Bill Henshaw

User avatar
tatewise
Megastar
Posts: 14970
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: how to remove alternate names with Clean Unwanted Fields

Postby tatewise » 01 Nov 2018 14:28

I was about to publish this revision in the Plugin Store, but realised it did not cater for instance indexes everywhere it should.
The further I inspected, there were a few other minor amendments also needed.

So try the attached Clean Unwanted Fields Plugin Version 1.1.2 Date 01 Nov 2018 that fixes all those features.

It should allow an [index] on any of the tags, and ensure it is a valid numerical index.
If applied to the left-most record type tag then the [index] identifies the [Record Id].

It would be good if you could apply some tests of your own.
Try some invalid index syntax using other types of brackets and non-numeric values and 0.
Try some valid index values, even on multiple tags in one data ref, and check the correct items get deleted.
Attachments
Clean Unwanted Fields.fh_lua
Version 1.1.2 Date 01 Nov 2018
(15.14 KiB) Downloaded 20 times
Mike Tate ~ researching the Tate and Scott family history.

User avatar
BillH
Megastar
Posts: 1330
Joined: 31 May 2010 03:40
Family Historian: V6.2
Location: Washington State, USA

Re: how to remove alternate names with Clean Unwanted Fields

Postby BillH » 01 Nov 2018 23:22

Mike,

I tried a variety of valid and invalid instances on a variety of facts and attributes and it worked in all the situations I tried.

Thanks
Bill Henshaw

User avatar
tatewise
Megastar
Posts: 14970
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: how to remove alternate names with Clean Unwanted Fields

Postby tatewise » 02 Nov 2018 16:49

Bill, that sounds good, but would a Result Set be useful?
Not for every deleted item, as that will often be too many, but just a sample of up to 9 per Data Reference.

Try the attached Clean Unwanted Fields Plugin Version 1.1.3 Date 02 Nov 2018 that adds a Result Set.
Attachments
Clean Unwanted Fields.fh_lua
Version 1.1.3 Date 02 Nov 2018
(17.97 KiB) Downloaded 21 times
Mike Tate ~ researching the Tate and Scott family history.

User avatar
BillH
Megastar
Posts: 1330
Joined: 31 May 2010 03:40
Family Historian: V6.2
Location: Washington State, USA

Re: how to remove alternate names with Clean Unwanted Fields

Postby BillH » 02 Nov 2018 20:21

Mike,

Not sure on this one. I don't see myself using this very often. Usually when I use the plugin I am deleting hundreds or even thousands of items so having only the first 9 of each type wouldn't really tell me much. Not sure if others would find it useful or not.
Bill Henshaw

User avatar
tatewise
Megastar
Posts: 14970
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: how to remove alternate names with Clean Unwanted Fields

Postby tatewise » 02 Nov 2018 20:30

I thought it might give some confidence that the desired classes of data were being deleted.
Does it do any harm to keep producing the Result Set even if not used?

BTW: The Export Gedcom File Plugin has a similar Result Set that only lists first 9 examples of each export Rule used.
Mike Tate ~ researching the Tate and Scott family history.

User avatar
BillH
Megastar
Posts: 1330
Joined: 31 May 2010 03:40
Family Historian: V6.2
Location: Washington State, USA

Re: how to remove alternate names with Clean Unwanted Fields

Postby BillH » 02 Nov 2018 20:58

Mike,

No harm at all. I'm sure it could be useful at times.
Bill Henshaw

User avatar
tatewise
Megastar
Posts: 14970
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: how to remove alternate names with Clean Unwanted Fields

Postby tatewise » 05 Nov 2018 08:51

Clean Unwanted Fields Plugin Version 1.2 Date 05 Nov 2018 has exploded into the Plugin Store. :)
Mike Tate ~ researching the Tate and Scott family history.

User avatar
wulliam
Diamond
Posts: 99
Joined: 03 Oct 2009 10:29
Family Historian: V6.2
Contact:

Re: how to remove alternate names with Clean Unwanted Fields

Postby wulliam » 06 Jan 2019 20:20

Have just used this plugin to great effect - many thanks!!
William


Return to “Plugin Discussions”

Who is online

Users browsing this forum: No registered users and 7 guests