* Sorting none dated facts and keeping them sorted
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Sorting none dated facts and keeping them sorted
Harking back to the old problem in FH of sorting items with no date (i.e. FH has no "sort date" option). In this case for using in a Narrative Report, Descendants by Generation, but also works with the Property Box.
I think I have a theoretically simple solution to sorting different Fact Types that have no date, but that can be classified in one of the FH Fact Type "Normal Time frames". The main purpose of the action is to put the facts in the right place/order in the Gedcom file as FH seems to use that order where there is nothing else to override it. The problem is to automate it for hundreds of items.
- This will only work where all the facts of a Fact Type are to have no date.
- I have tested this with FH Fact Types with a "Normal Time frame" of shortly after birth but should work for different or multiple Time Frames.
So in this example let's say we have 3 custom Events FACTTYPE1, FACTTYPE2, FACTTYPE3.
- - - - -
<> Take a good backup of your project, and/or experiment on a copied Project.
<> Run the Standard Query - All Facts (or any query that shows the fact type you are interested in and displays the date in its own column).
- sort on fact, ensure all facts FACTTYPE1/2/3 have no date. If any do, delete just the dates. (The usual select 1st date, hold shift key, select last date, delete).
<> Then edit the GEDCOM file in a program that has a global replace command that can add CRLF (new line).
- This example uses Notepad++ but see also Unicode UTF-16 and text editors (12010).
- place your cursor at the beginning of the file, otherwise it might miss those items before the cursor, I don't understand why this is needed!!
- menu Search > Replace (or Ctrl+H)
- tick Search Mode = Extended
- In Find what enter (no quotes): "1 EVEN\r\n2 TYPE FACTTYPE1\r\n"
(In extended search mode the "\r\n" are CRLF [line feed] as seems to be used in FH Gedcoms).
- In Replace with enter: "1 EVEN\r\n2 TYPE FACTTYPE1\r\n2 DATE 9030\r\n"
N.B. Choose dates for your items that are either much higher or much lower than any other dates you may have, depending on how you want them to fit in with any other Fact Types in that Time Frame, and in the order you want them to eventually display. In this example if you want your items before Baptism, set the Fact type to just after birth with the fact dates to very early or set the Fact Type to Birth but with high dates to ensure the none dated facts come after the birth fact. There are lots of permutations.
N.B. It is worth doing a check that the above search replace matches your file, for instance if you do not use a Custom Event, the format would be similar but different.
- Replace all
- Do the same global changes for the other Fact Types + new date you wish to keep in order.
- save and exit the file.
<> Open the project in FH > Tools > Reorder out of sequence data.
<> Save the project. THIS IS IMPORTANT to save the Facts in order.
<> You will now note that items are in order as per new dates.
<> Run a facts query as above and delete all the new dates.
<> Save the project again.
<> Open the project in FH > Tools > Reorder out of sequence data. (As far as I can work out, it seems that if you subsequently alter a Fact Types "Normal Time frame", a "Reorder out of sequence data" will also reorder the items in the Gedcom.
<> Save the project again.
<> All your items should now be in order within the Gedcom file and hence in reports, Property box etc, and if you wish to export your Gedcom, the receiving program will at least have them in the order you want.
- - - - -
I'm sure there will be a neater and more automated way of performing this, but the basic principle is simple.
I am very wary of editing the Gedcom file directly outside of FH, so before I perform this in anger, any comments re potential pitfalls, file corruptions etc would be gratefully received. My tests seem to work fine.
I think I have a theoretically simple solution to sorting different Fact Types that have no date, but that can be classified in one of the FH Fact Type "Normal Time frames". The main purpose of the action is to put the facts in the right place/order in the Gedcom file as FH seems to use that order where there is nothing else to override it. The problem is to automate it for hundreds of items.
- This will only work where all the facts of a Fact Type are to have no date.
- I have tested this with FH Fact Types with a "Normal Time frame" of shortly after birth but should work for different or multiple Time Frames.
So in this example let's say we have 3 custom Events FACTTYPE1, FACTTYPE2, FACTTYPE3.
- - - - -
<> Take a good backup of your project, and/or experiment on a copied Project.
<> Run the Standard Query - All Facts (or any query that shows the fact type you are interested in and displays the date in its own column).
- sort on fact, ensure all facts FACTTYPE1/2/3 have no date. If any do, delete just the dates. (The usual select 1st date, hold shift key, select last date, delete).
<> Then edit the GEDCOM file in a program that has a global replace command that can add CRLF (new line).
- This example uses Notepad++ but see also Unicode UTF-16 and text editors (12010).
- place your cursor at the beginning of the file, otherwise it might miss those items before the cursor, I don't understand why this is needed!!
- menu Search > Replace (or Ctrl+H)
- tick Search Mode = Extended
- In Find what enter (no quotes): "1 EVEN\r\n2 TYPE FACTTYPE1\r\n"
(In extended search mode the "\r\n" are CRLF [line feed] as seems to be used in FH Gedcoms).
- In Replace with enter: "1 EVEN\r\n2 TYPE FACTTYPE1\r\n2 DATE 9030\r\n"
N.B. Choose dates for your items that are either much higher or much lower than any other dates you may have, depending on how you want them to fit in with any other Fact Types in that Time Frame, and in the order you want them to eventually display. In this example if you want your items before Baptism, set the Fact type to just after birth with the fact dates to very early or set the Fact Type to Birth but with high dates to ensure the none dated facts come after the birth fact. There are lots of permutations.
N.B. It is worth doing a check that the above search replace matches your file, for instance if you do not use a Custom Event, the format would be similar but different.
- Replace all
- Do the same global changes for the other Fact Types + new date you wish to keep in order.
- save and exit the file.
<> Open the project in FH > Tools > Reorder out of sequence data.
<> Save the project. THIS IS IMPORTANT to save the Facts in order.
<> You will now note that items are in order as per new dates.
<> Run a facts query as above and delete all the new dates.
<> Save the project again.
<> Open the project in FH > Tools > Reorder out of sequence data. (As far as I can work out, it seems that if you subsequently alter a Fact Types "Normal Time frame", a "Reorder out of sequence data" will also reorder the items in the Gedcom.
<> Save the project again.
<> All your items should now be in order within the Gedcom file and hence in reports, Property box etc, and if you wish to export your Gedcom, the receiving program will at least have them in the order you want.
- - - - -
I'm sure there will be a neater and more automated way of performing this, but the basic principle is simple.
I am very wary of editing the Gedcom file directly outside of FH, so before I perform this in anger, any comments re potential pitfalls, file corruptions etc would be gratefully received. My tests seem to work fine.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sorting none dated facts and keeping them sorted
Yes Jim, after some brief experiments, it does appear to work in a few limited circumstances.
It is particularly good for the Birth and Death related Time Frames, but not so sure about Life.
The Marriage related Time Frames do NOT work at all for Individual Facts (only for Family Facts).
Using a Plugin to manage adding/removing the Dates would be much much safer.
It is particularly good for the Birth and Death related Time Frames, but not so sure about Life.
The Marriage related Time Frames do NOT work at all for Individual Facts (only for Family Facts).
Using a Plugin to manage adding/removing the Dates would be much much safer.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Sorting none dated facts and keeping them sorted
Sorting (moving) Occupations works for the 2nd and 3rd entered fact (by up/down button) but it seems the first one remains always at the bottom.
(Workaround: copy/paste the 1st to make it the 4th so it can be included in sorting; delete the 1st fact after sorting)
Is there a special reason that the first entered fact cannot be moved like the others?
(Workaround: copy/paste the 1st to make it the 4th so it can be included in sorting; delete the 1st fact after sorting)
Is there a special reason that the first entered fact cannot be moved like the others?
Re: Sorting none dated facts and keeping them sorted
I have often come across this with notes. I find that rather try to move first note down (usually can’t because arrow greyed out), I often find that it will allow me to move second note up - worth a try in your scenario.
The greyed out arrow often gets ‘ungreyed’ when I move focus to another individual and then move focus back, presumably after a screen refresh. But this isn’t consistent.
The greyed out arrow often gets ‘ungreyed’ when I move focus to another individual and then move focus back, presumably after a screen refresh. But this isn’t consistent.
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sorting none dated facts and keeping them sorted
See how_to:sorting_children|> Sorting Children, Spouses & Facts into Order for general advice that explains some of the problems described earlier.
@Papamuse: You have posted in a very old thread, and your description is not very clear to me.
Which "up/down buttons" are you referring to?
The large straight black buttons in the centre of the Facts tab, or the small curved black buttons top right of All tab?
You say the "first one remains always at the bottom".
Usually the first entered Occupation fact would be at the top, so I don't understand.
Anyway, I could move all three Occupation facts up and down using either Facts tab or All tabs up/down buttons.
BUT on the Facts tab no Fact can be moved up/down outside its Normal Time Frame.
So for instance, Occupation facts have Normal Time Frame of Life, so cannot be moved before Birth/Baptism facts nor after Death/Burial facts.
Also see the plugins:help:order_facts_by_sort_date:order_facts_by_sort_date|> Order Facts by Sort Date Plugin advice that explains how a Sort Date can be added to every Fact and sorted accordingly.
@Mike: Not sure what you mean by "notes". Do you mean a custom fact for adding general notes?
Also look at the order in the All tab, because the Facts tab can be misleading.
The Facts tab buttons are greyed out if the Fact is not within its Normal Time Frame.
@Papamuse: You have posted in a very old thread, and your description is not very clear to me.
Which "up/down buttons" are you referring to?
The large straight black buttons in the centre of the Facts tab, or the small curved black buttons top right of All tab?
You say the "first one remains always at the bottom".
Usually the first entered Occupation fact would be at the top, so I don't understand.
Anyway, I could move all three Occupation facts up and down using either Facts tab or All tabs up/down buttons.
BUT on the Facts tab no Fact can be moved up/down outside its Normal Time Frame.
So for instance, Occupation facts have Normal Time Frame of Life, so cannot be moved before Birth/Baptism facts nor after Death/Burial facts.
Also see the plugins:help:order_facts_by_sort_date:order_facts_by_sort_date|> Order Facts by Sort Date Plugin advice that explains how a Sort Date can be added to every Fact and sorted accordingly.
@Mike: Not sure what you mean by "notes". Do you mean a custom fact for adding general notes?
Also look at the order in the All tab, because the Facts tab can be misleading.
The Facts tab buttons are greyed out if the Fact is not within its Normal Time Frame.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Sorting none dated facts and keeping them sorted
Mike,
I was referring to the Note tab in the individuals property box.
I use this to make general notes about an individual, often starting the note with a date.
E.g. 1861 niece Jennifer Brown was staying
I then add another note, and try to move it above the 1861 entry, which is when I find I can’t because the arrows are greyed out. However, in these circumstances, I am often able to move the 1861 entry down - go figure
I was referring to the Note tab in the individuals property box.
I use this to make general notes about an individual, often starting the note with a date.
E.g. 1861 niece Jennifer Brown was staying
I then add another note, and try to move it above the 1861 entry, which is when I find I can’t because the arrows are greyed out. However, in these circumstances, I am often able to move the 1861 entry down - go figure
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sorting none dated facts and keeping them sorted
Dates within Notes are not Dates as far as FH is concerned, but just plain text, so none of the sort tools work.
Also, like the Facts tab, the Notes tab may NOT list items in GEDCOM order and upset its up/down buttons.
So check the All tab and use its up/down buttons instead.
Also, like the Facts tab, the Notes tab may NOT list items in GEDCOM order and upset its up/down buttons.
So check the All tab and use its up/down buttons instead.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Sorting none dated facts and keeping them sorted
Mike,
Sorry, you misunderstood the point I was trying to make.
I’m aware that dates in notes are just numbers and not dates, but in order to sort them manually (the only way to do it) I rely on the arrows, but can’t when they’re greyed out.
Sorry, you misunderstood the point I was trying to make.
I’m aware that dates in notes are just numbers and not dates, but in order to sort them manually (the only way to do it) I rely on the arrows, but can’t when they’re greyed out.
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Re: Sorting none dated facts and keeping them sorted
> Which "up/down buttons" are you referring to?
> The large straight black buttons in the centre of the Facts tab, or the small curved black buttons top right of All tab?
I was referring to the large straight black buttons in the centre of the Facts tab.
> You say the "first one remains always at the bottom".
> Usually the first entered Occupation fact would be at the top, so I don't understand.
What I wanted to say is that I would expect that the up/down buttons are active for all 3 occupations facts (all of them without a date).
Instead, only two of them had the buttons active, for the third one both buttons were greyed out.
Maybe I was wrong when I assumed that the one with greyed out up/down buttons was the first one which was entered.
> The large straight black buttons in the centre of the Facts tab, or the small curved black buttons top right of All tab?
I was referring to the large straight black buttons in the centre of the Facts tab.
> You say the "first one remains always at the bottom".
> Usually the first entered Occupation fact would be at the top, so I don't understand.
What I wanted to say is that I would expect that the up/down buttons are active for all 3 occupations facts (all of them without a date).
Instead, only two of them had the buttons active, for the third one both buttons were greyed out.
Maybe I was wrong when I assumed that the one with greyed out up/down buttons was the first one which was entered.
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Sorting none dated facts and keeping them sorted
The solution for both of you in those situations is to use the All tab buttons instead.
As I have said several times, the order shown on the Facts and Notes tabs may NOT be the actual order of the items in the GEDCOM and that affects which up/down buttons are enabled.
For example, if an Occupation fact is positioned in the GEDCOM file before Birth or after Death, then it is not in a valid Normal Time Frame position, and the Facts tab buttons will be disabled. However, on the Facts tab that Occupation fact will still be listed in Date order. Similar scenarios can apply to Notes.
As I have said several times, the order shown on the Facts and Notes tabs may NOT be the actual order of the items in the GEDCOM and that affects which up/down buttons are enabled.
For example, if an Occupation fact is positioned in the GEDCOM file before Birth or after Death, then it is not in a valid Normal Time Frame position, and the Facts tab buttons will be disabled. However, on the Facts tab that Occupation fact will still be listed in Date order. Similar scenarios can apply to Notes.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry