* convert lower case surnames
convert lower case surnames
I have used the Plugin to convert surnames in all capitals to mixed case. However, I have many surnames that were originally entered in all lower case - they display OK in upper case when required, which is fine - but I would like to convert these also to the preferred mixed case format. The 'convert surnames' Plugin doesn't do this for names in all lower case. Would it be difficult to amend the Plugin to do this as well as, or would it mean writing a new one for this purpose?
I've never written any Plugins, but did take a look at the surname convert one via the Edit option, but I'm reluctant to start tinkering with it given that I don't know what would need to be changed.
Any suggestions for resolving the problem of this particular conversion would be much appreciated.
I've never written any Plugins, but did take a look at the surname convert one via the Edit option, but I'm reluctant to start tinkering with it given that I don't know what would need to be changed.
Any suggestions for resolving the problem of this particular conversion would be much appreciated.
Kind regards, Stuart
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: convert lower case surnames
I took a quick look and if you change lines 51 and 52 replacing :upper with :lower to
and line 92 again replacing upper with lower to
Please check the result set carefully and use the undo if needed.
Code: Select all
if strSurname == strSurname:lower() then
strSurname = strSurname:lower()
Code: Select all
tblSurname2['/'..line:lower()..'/'] = '/'..line..'/'
Please check the result set carefully and use the undo if needed.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
Re: convert lower case surnames
Jane,
I saved a renamed copy of the Plugin and made the alterations you suggested. It has worked perfectly, including the handful of McNames in my records.
I appreciate your responding so quickly, and providing me with such a simple but effective solution.
Many thanks for your help.
Stuart
I saved a renamed copy of the Plugin and made the alterations you suggested. It has worked perfectly, including the handful of McNames in my records.
I appreciate your responding so quickly, and providing me with such a simple but effective solution.
Many thanks for your help.
Stuart
Kind regards, Stuart
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: convert lower case surnames
Jane, if the following changes are made then the Plugin will convert both all /UPPERCASE/ and all /lowercase/ surnames at the same time.
Firstly replace lines 51 & 52 with:(The original line 52 was redundant anyway.)
Secondly insert after line 92:
Since all /UPPERCASE/ and all /lowercase/ surnames are distinct, there is no clash in the tblSurname2 table.
Firstly replace lines 51 & 52 with:
Code: Select all
if strSurname == strSurname:upper()
or strSurname == strSurname:lower() thenSecondly insert after line 92:
Code: Select all
tblSurname2['/'..line:lower()..'/'] = '/'..line..'/'Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: convert lower case surnames
I thought that was the case, but did not have time to check it in detail. I'll look at again on my return.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: convert lower case surnames
I now realise that the line 52 that was redundant in original version, is now essential to avoid listing the same Mixed Case Surname twice, when both /UPPERCASE/ and /lowercase/ versions of the same Surname exist.
e.g.
/MUNRO/ and /munro/ will list Munro twice.
So line 52, now line 53, needs to be reinstated:
Lines 82 - 84 would benefit from becoming:
Also, of course, some message text will need updating to accommodate both /UPPERCASE/ and /lowercase/ names.
e.g.
/MUNRO/ and /munro/ will list Munro twice.
So line 52, now line 53, needs to be reinstated:
Code: Select all
strSurname = strSurname:upper()Code: Select all
if strList == nil
or strList:gsub("%s*","") == "" then
-- Cancel Pressed or entire list deleted
fhMessageBox('Update Cancelled')
elseMike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry