GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 

GenoPro Support Forum




Create a text file containing unique surnames

Click to view RSS...
Author Get a list of every last names into a plain .txt file
Posted Monday, December 12, 2005 - Post #9544
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Moderators
Customers
Gamma
FamilyTrees.GenoPro.com
Translator
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 11:52 AM
Posts: 4,886, Visits: 22,781
Replace the SortByCounter with SortByKey.

oStringDictionaryNames.SortByKey
Posted Monday, December 12, 2005 - Post #9546
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.0.1.5

Last Login: Saturday, March 14, 2020
Posts: 365, Visits: 3,680
Thanks, this is much better, though it makes the list Z to A in a long column and it would be easier if it was A to Z and with the names following each other between commas, like on the home.htm

Edited: Tuesday, December 13, 2005 by GenoProSupport
Posted Tuesday, December 13, 2005 - Post #9547
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Moderators
Customers
Gamma
FamilyTrees.GenoPro.com
Translator
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 11:52 AM
Posts: 4,886, Visits: 22,781
iaintait (12/13/2005)
Thanks, this is much better, though it makes the list Z to A in a long column and it would be easier if it was A to Z and with the names following each other between commas, like on the home.htm

Remove the following line:

oStringDictionaryNames.Reverse
Posted Tuesday, December 13, 2005 - Post #9548
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.0.1.5

Last Login: Saturday, March 14, 2020
Posts: 365, Visits: 3,680
Thanks again, this time I found that if I make a FamilyNames.htm instead of .txt it is easier for me to add commas and line breaks and format the fonts to make my names list as on my web site home page.

Could commas be added between each name like in your home.htm ?

Posted Tuesday, March 2, 2010 - Post #25573
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.0.1.5

Last Login: Saturday, March 14, 2020
Posts: 365, Visits: 3,680
Hi Dan, I am trying to update the large compilation to your sitre but keep getting timed out as the tree is about 42000 names;

I have placed the file FamilyNames.txt in the test skin with this text inside:-

<%[
' Use a string dictionary to count the frequency of each last name.
' Counting the last names ensures each entry is unique.
' We could use the ObjectRepertory, but the StringDictionary is faster.
Set oStringDictionaryNames = Util.NewStringDictionary()
For Each i In Individuals
oStringDictionaryNames.Add i.Name.Last
Next

' Sort the dictionary from the largest to the smallest number
' to have the most popular last name at the top of the list
oStringDictionaryNames.SortByKey
iNameLast = oStringDictionaryNames.Count - 1
For iName = 0 To iNameLast
  strNameLast = oStringDictionaryNames.Key(iName)
  If (strNameLast <> "") Then
    Report.WriteLn strNameLast
  End If
Next
]%>

with the control <Report Template="FamilyNames.txt" /> in the config xml but this creates an enormously long vertical column of names which is very difficult to format as I have to move each name up a line, add a comma and a space and then move the next name up etc. and with thousands of unique names, this will take ages.

Please could you help me with this and show me how to add the comma and space between the names and have them follow each other on the same line. Unsure

As an after-thought, would it be possible to make a skin "Export FamilyNames List" which would behave a bit like the "Export to Gedcom" and only create a text file or htm file of the names list as I have mentioned above ? Smile

Edited: Tuesday, March 2, 2010 by IainTait

Posted Tuesday, March 2, 2010 - Post #25578
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: Yesterday @ 8:18 PM
Posts: 3,424, Visits: 26,489
Try this (not tested!!) which should also add a line break after each letter of the alphabet

<%[
' Use a string dictionary to count the frequency of each last name.
' Counting the last names ensures each entry is unique.
' We could use the ObjectRepertory, but the StringDictionary is faster.
Set oStringDictionaryNames = Util.NewStringDictionary()
For Each i In Individuals
  oStringDictionaryNames.Add i.Name.Last
Next

' Sort the dictionary
oStringDictionaryNames.SortByKey
iNameLast = oStringDictionaryNames.Count - 1
strPrev = ""
strSep = ""
For iName = 0 To iNameLast
  strNameLast = oStringDictionaryNames.Key(iName)
  If (strNameLast <> "") Then
    If (strPrev = "") Then strPrev = Left(strNameLast, 1)
    If (strPrev <> Left(strNameLast, 1)) Then
       Report.WriteLn
       strSep = ""
       strPrev = Left(strNameLast, 1)
    End If
    Report.Write strSep & strNameLast
    strSep = ", "
  End If
Next
Report.WriteLn
]%>




'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"


Edited: Wednesday, March 3, 2010 by Ron
Posted Wednesday, March 3, 2010 - Post #25586
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.0.1.5

Last Login: Saturday, March 14, 2020
Posts: 365, Visits: 3,680
Thanks very much Ron.

I noticed that at the beginning of the code you have put   &lt;%[ instead of <%[ so I tried both and found that the first one did nothing and the second one in the FamilyNames.txt gave the list below

Corbett, Crawford
Falconer
Hargin
McKean
Peacock
Sinclair
Smith
Tait
Tannahill
Watson
Whyte
Wilson


As this is a small test tree with few names, it would appear to work except for the end of the list so I will try another tree with more names.

Thanks again.

 



Edited: Wednesday, March 3, 2010 by IainTait
Posted Wednesday, March 3, 2010 - Post #25587
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.0.1.5

Last Login: Saturday, March 14, 2020
Posts: 365, Visits: 3,680
Hi Ron, I have just tried the code with a larger tree but unfortunately got this list

Adams, Alken
Barber
Barlow
Beevor
Bragg
Brereton
Bryan
Bush
Challenger
Clayton
Collier
Collins
Cussen
Donald
Eckstein
Edge
Edwards
Eldridge
Farrar
Fish
Fox
Gahan
Gaile
Glenn
Glover
Goodwin-Wilson

which seems rather strange as the first line has a comma with a space after the comma but all the others are as before.

Edited: Wednesday, March 3, 2010 by IainTait

Posted Wednesday, March 3, 2010 - Post #25588
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: Yesterday @ 8:18 PM
Posts: 3,424, Visits: 26,489
Yes there was a line missing from my code. I have corrected my earlier post with the change in bold.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Wednesday, March 3, 2010 - Post #25589
Famous Writer

Famous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous WriterFamous Writer

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.0.1.5

Last Login: Saturday, March 14, 2020
Posts: 365, Visits: 3,680
Fabulous !Tongue: Thanks very much Ron.

the list is perfect for formatting

Adams, Alken
Barber, Barlow, Beevor, Bragg, Brereton, Bryan, Bush
Challenger, Clayton, Collier, Collins, Cussen
Donald
Eckstein, Edge, Edwards, Eldridge

etc.

All I need to do now is to ann the letters of the alfabet in an htm file as follows:-

   <center>   A

Adams, Alken

                         B
Barber, Barlow, Beevor, Bragg, Brereton, Bryan, Bush

                         C
Challenger, Clayton, Collier, Collins, Cussen

etc.

Would it be possible to create a skin that produces only this list, a bit like the gedcom file skin or the birthday skin ? Whistling



Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse
Active: 3 - 1 guest, 1 member, 0 anonymous.
Refresh