* Remove last updated (CHANged) date from exported GEDCOM
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Remove last updated (CHANged) date from exported GEDCOM
When I export a GEDCOM for displaying elsewhere (e.g. Rootsweb trees), the last updated (last CHANged) date often displays in a way that sometimes makes an entry confusing and is not needed for genealogical purposes.
I could create a macro (notepad++ or even MSWORD and save as text) to remove the CHAN + DATE + TIME lines from the GEDCOM.
But would this invalidate the GEDCOM file?
I was hoping to do this with a copy of the GEDCOM with FH. However, from the queries I have looked at (e.g. last updated individual records), the last updated column is greyed out and cannot be deleted.
Does anyone know of another method for this?
I could create a macro (notepad++ or even MSWORD and save as text) to remove the CHAN + DATE + TIME lines from the GEDCOM.
But would this invalidate the GEDCOM file?
I was hoping to do this with a copy of the GEDCOM with FH. However, from the queries I have looked at (e.g. last updated individual records), the last updated column is greyed out and cannot be deleted.
Does anyone know of another method for this?
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
I believe the CHAN tag and its subsidiary tags are optional in GEDCOM 5.5, but there are no features of FH that allow them to be deleted, not even using a Plugin.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
You could write a plugin to work directly on the exported gedcom file and remove them. Just remember when FH opens the file it will add them back in.
I am surprised other programs are not handing the data correctly, it might be worth talking to those programs user groups to see if they can be fixed.
I am surprised other programs are not handing the data correctly, it might be worth talking to those programs user groups to see if they can be fixed.
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."
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
thanks tatewise and Jane. I thought it would be a long shot.
For me in the present I think a macro in notepad++ or MSword save > txt will be easiest, for the future I can experiment with Lua. At least as the file will be a copy, there is no problem of losing data.
I noticed the problem on Rootsweb trees which seems worse with the FH GEDCOM than that from TMG. It's not that it is wrong, it's just that the position of the CHANged Date + Time might cause confusion.
The TMG "1 CHAN" is just followed by a "2 DATE" and no TIME.
The FH "1 CHAN" is followed by a "2 DATE" and then mostly "3 TIME 00:00:00", presumably because my input to FH from TMG did not export a TIME.
The good thing about the Rootsweb trees is that they seem to be able to display everything textual, whatever you throw at it, which is good, but can also make it cluttered. I could never understand why Ancestry trees, from the same stable, still do not display notes/text from events, this they freely admit, but have not fixed from their inception many years ago.
For me in the present I think a macro in notepad++ or MSword save > txt will be easiest, for the future I can experiment with Lua. At least as the file will be a copy, there is no problem of losing data.
I noticed the problem on Rootsweb trees which seems worse with the FH GEDCOM than that from TMG. It's not that it is wrong, it's just that the position of the CHANged Date + Time might cause confusion.
The TMG "1 CHAN" is just followed by a "2 DATE" and no TIME.
The FH "1 CHAN" is followed by a "2 DATE" and then mostly "3 TIME 00:00:00", presumably because my input to FH from TMG did not export a TIME.
The good thing about the Rootsweb trees is that they seem to be able to display everything textual, whatever you throw at it, which is good, but can also make it cluttered. I could never understand why Ancestry trees, from the same stable, still do not display notes/text from events, this they freely admit, but have not fixed from their inception many years ago.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
I hate to disagree with Jane (again!) but FH does NOT add any missing CHAN fields back in until the Record is actually changed.
This is the subject of a FH support dialogue with Simon Orde, who agrees that it might be worth adding an option when importing a GEDCOM to set any missing CHANge fields.
However, I admit I overlooked the possibility of a Plugin editing the exported standalone GEDCOM file directly rather than through FH.
If you like I could write one very quickly.
This is the subject of a FH support dialogue with Simon Orde, who agrees that it might be worth adding an option when importing a GEDCOM to set any missing CHANge fields.
However, I admit I overlooked the possibility of a Plugin editing the exported standalone GEDCOM file directly rather than through FH.
If you like I could write one very quickly.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
Try the attached Plugin on a standalone copy of your Gedcom file as follows:
Just single-click the Delete CHANge Fields attachment to install into FH.
In FH use File > Inport/Export > Export > GEDCOM File.
Double-click this exported standalone GEDCOM file to open it in FH.
Use Tools > Plugins > Delete CHANge Fields > Run to remove the CHAN fields.
QED
Just single-click the Delete CHANge Fields attachment to install into FH.
In FH use File > Inport/Export > Export > GEDCOM File.
Double-click this exported standalone GEDCOM file to open it in FH.
Use Tools > Plugins > Delete CHANge Fields > Run to remove the CHAN fields.
QED
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
run and tested on a test file and goes to Rootsweb trees perfectly, even better than before as all Changed dates do not show now.
I checked out the code and I trust it was a simple change to an existing piece of code. Having got your example I might be able to amend for other purposes. But I have no idea yet, what is going on in the first 3/4 of the code!
Far more "elegant" than my macro would have been.
It is just a pity that Rootsweb trees won't display in monospaced font then my text would line up in neat columns. I've not experimented with tabs, but I find them inconsistent across platforms/programs.
many thanks again.
I checked out the code and I trust it was a simple change to an existing piece of code. Having got your example I might be able to amend for other purposes. But I have no idea yet, what is going on in the first 3/4 of the code!
Far more "elegant" than my macro would have been.
It is just a pity that Rootsweb trees won't display in monospaced font then my text would line up in neat columns. I've not experimented with tabs, but I find them inconsistent across platforms/programs.
many thanks again.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
Perhaps a little explanation of the intricacies of the Plugin are in order.
It was an amalgam of various other Plugins of mine.
The first two functions are taken directly from the plugins:code_snippets:save_string_to_file|> Save String To File (code snippet).
The third function GetGedFile() uses the FH API and IUP library to obtain the GEDCOM file path.
If FH is open in Project Mode or with an unsaved GEDCOM then the Plugin must be inhibited.
IUP library messages tell the user what is happening.
If FH is open in Standalone Gedcom Mode and user responds Yes i.e. 1st button, the GEDCOM file path is returned.
In all other cases the special nil value is returned.
The function Main() obtains the value returned by GetGedFile() and only proceeds if it is not nil.
The rest I suspect you understand.
But the plugins:index|> Family Historian Plugins > Developer Guide gives a lot more advice.
It was an amalgam of various other Plugins of mine.
The first two functions are taken directly from the plugins:code_snippets:save_string_to_file|> Save String To File (code snippet).
The third function GetGedFile() uses the FH API and IUP library to obtain the GEDCOM file path.
If FH is open in Project Mode or with an unsaved GEDCOM then the Plugin must be inhibited.
IUP library messages tell the user what is happening.
If FH is open in Standalone Gedcom Mode and user responds Yes i.e. 1st button, the GEDCOM file path is returned.
In all other cases the special nil value is returned.
The function Main() obtains the value returned by GetGedFile() and only proceeds if it is not nil.
The rest I suspect you understand.
But the plugins:index|> Family Historian Plugins > Developer Guide gives a lot more advice.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
thanks mike, those explanations are very helpful to me and hopefully others, from the "code snippet" you mentioned I would not have guessed what it did, the snippet makes more sense in a real situation, but then I still need to find time to understand the flow/structure of the way the code works. When I eventually get into it, I'm hoping there will be full example simple scripts (is it a script or a program?) showing how it hangs together. I found the "step into" interesting/ useful when I butchered your other plugin.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
It's worth checking out the Plugin Help there is a short introduction to plugins there.
The use of a main() function call at the end of a script means you can define the functions in any order as by the time they are used the interpreter will have seen them all. You can see a variety of worked scripts in the Plugin Store any of which can be edited.
The Code Snippet section as Mike has already pointed out has both the "cut and paste" code and in most cases an example of how to use them.
The use of a main() function call at the end of a script means you can define the functions in any order as by the time they are used the interpreter will have seen them all. You can see a variety of worked scripts in the Plugin Store any of which can be edited.
The Code Snippet section as Mike has already pointed out has both the "cut and paste" code and in most cases an example of how to use them.
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: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
The first article in plugins:index|> Family Historian Plugins > Developer Guide, namely plugins:getting_started|> Getting Started Writing Plugins gives some basic pointers.
Jane, in that advice it says "Open a Plugin for editing and place the cursor in the middle of a word and then press F1 to get context sensitive help with that word." but I have never got that to work
Jane, in that advice it says "Open a Plugin for editing and place the cursor in the middle of a word and then press F1 to get context sensitive help with that word." but I have never got that to work
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
It works for me, but it only works for fh functions and methods, but not lua key words.
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: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
Ah, yes! I have updated that KB page to clarify that detail.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
I have posted Plugin V1.1 dated 16 Aug 2014 on my SkyDrive at Export Gedcom File.
This is close to being complete, with bug fixes, online help pages, etc.
Check the Roots Web Ancestry Gedcom export mode, which not only removes CHANge date/time but also converts all custom FH tags to standard GEDCOM 5.5.
This is close to being complete, with bug fixes, online help pages, etc.
Check the Roots Web Ancestry Gedcom export mode, which not only removes CHANge date/time but also converts all custom FH tags to standard GEDCOM 5.5.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
Mike,
2 rather rushed tests:
<> Test 1 to Rootsweb WorldConnect Family Trees: - with a large GEDCOM, but fairly basic as just exported INTO FH from TMG, i.e. only basic Source info, NO Source text etc.
- This worked fine, especially for the removal of Last CHANed date and time, which was my original request to make the data display less confusing.
<> Test 2 to Rootsweb WorldConnect Family Trees: - with a test AS Method 1 shared Source.
- All the data displayed fine, however:
original
0 @S1@ SOUR
1 TITL 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
1 _TYPE Census
1 TEXT auto text
2 CONT Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
2 CONT dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
2 CONT name surname,Son,M,30,S,,,,,oc,,,,pres,,
2 CONT mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
1 NOTE note
2 CONT l2
1 PUBL RG14 jhghj census 1911 ref id
1 CHAN
2 DATE 17 AUG 2014
3 TIME 12:53:44
after Plugin
0 @S1@ SOUR
1 TITL 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
1 TEXT auto text
2 CONT Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
2 CONT dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
2 CONT name surname,Son,M,30,S,,,,,oc,,,,pres,,
2 CONT mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
2 CONT Source Type: Census
2 CONT note
2 CONT l2
1 PUBL RG14 jhghj census 1911 ref id
you will notice that the
1 NOTE note
is changed to
2 CONT note
This displays in Rootsweb trees as:
Sources:
Title: 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
Text: auto text
Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
name surname,Son,M,30,S,,,,,oc,,,,pres,,
mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
Source Type: Census
note
l2
Publication: RG14 jhghj census 1911 ref id
So I amended the Gedcom with
1 NOTE note (instead of 2 CONT note)
This displays in Rootsweb trees as:
Sources:
Title: 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
Text: auto text
Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
name surname,Son,M,30,S,,,,,oc,,,,pres,,
mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
Source Type: Census
Note:
note
l2
Publication: RG14 jhghj census 1911 ref id
As you can see the "1 NOTE note" is technically better, but in practice all the information is still there after the plugin. Perhaps this amendment is for another conversion but does not seem to be needed for the Rootsweb trees.
2 rather rushed tests:
<> Test 1 to Rootsweb WorldConnect Family Trees: - with a large GEDCOM, but fairly basic as just exported INTO FH from TMG, i.e. only basic Source info, NO Source text etc.
- This worked fine, especially for the removal of Last CHANed date and time, which was my original request to make the data display less confusing.
<> Test 2 to Rootsweb WorldConnect Family Trees: - with a test AS Method 1 shared Source.
- All the data displayed fine, however:
original
0 @S1@ SOUR
1 TITL 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
1 _TYPE Census
1 TEXT auto text
2 CONT Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
2 CONT dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
2 CONT name surname,Son,M,30,S,,,,,oc,,,,pres,,
2 CONT mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
1 NOTE note
2 CONT l2
1 PUBL RG14 jhghj census 1911 ref id
1 CHAN
2 DATE 17 AUG 2014
3 TIME 12:53:44
after Plugin
0 @S1@ SOUR
1 TITL 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
1 TEXT auto text
2 CONT Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
2 CONT dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
2 CONT name surname,Son,M,30,S,,,,,oc,,,,pres,,
2 CONT mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
2 CONT Source Type: Census
2 CONT note
2 CONT l2
1 PUBL RG14 jhghj census 1911 ref id
you will notice that the
1 NOTE note
is changed to
2 CONT note
This displays in Rootsweb trees as:
Sources:
Title: 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
Text: auto text
Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
name surname,Son,M,30,S,,,,,oc,,,,pres,,
mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
Source Type: Census
note
l2
Publication: RG14 jhghj census 1911 ref id
So I amended the Gedcom with
1 NOTE note (instead of 2 CONT note)
This displays in Rootsweb trees as:
Sources:
Title: 1911 Census UK wigan, wig lane RG14 jhghj census 1911 ref id (other info)
Text: auto text
Name,Relation,Sex,Age,Married,Years,Chd Born,Chd Living,Chd Died,Occupation,Industry,Employ Status,At Home,Where Born,Nationality,Infirmity
dad surname,Head,M,50,M,,,,,oc,,,,leyland,b,
name surname,Son,M,30,S,,,,,oc,,,,pres,,
mum surname,Wife,F,51,M,,,,,hwife,,,,wher born,,
Source Type: Census
Note:
note
l2
Publication: RG14 jhghj census 1911 ref id
As you can see the "1 NOTE note" is technically better, but in practice all the information is still there after the plugin. Perhaps this amendment is for another conversion but does not seem to be needed for the Rootsweb trees.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
Jim, thank you for the excellent feedback.
That is a bug that I have also just spotted and will be fixed in next version.
BTW: Is RootsWeb WorldConnect a more correct name than RootsWeb Ancestry ?
That is a bug that I have also just spotted and will be fixed in next version.
BTW: Is RootsWeb WorldConnect a more correct name than RootsWeb Ancestry ?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
This is the link to the front pageBTW: Is RootsWeb WorldConnect a more correct name than RootsWeb Ancestry ?
http://wc.rootsweb.ancestry.com/ which would suggest it is. This is of course Rootsweb supported I think wholly by Ancestry.com, not to be confused with FamilySearch Family Tree (I note Legacy and Rootmagic both sync with it, but I don't think FH does; not sure how useful that would be).
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
I have posted Plugin V1.1 dated 20 Aug 2014 on my SkyDrive at Export Gedcom File.
This should be slightly faster on large databases, adds a few more conversion Rules, and creates a Result Set of the Rules used and which Records were converted.
There is an Extra Options tab to allow the Rules to be customised for each target program format.
It fixes the bug discussed above.
This should be slightly faster on large databases, adds a few more conversion Rules, and creates a Result Set of the Rules used and which Records were converted.
There is an Extra Options tab to allow the Rules to be customised for each target program format.
It fixes the bug discussed above.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- jimlad68
- Megastar
- Posts: 911
- Joined: 18 May 2014 21:01
- Family Historian: V7
- Location: Sheffield, Yorkshire, UK (but from Lancashire)
- Contact:
Re: Remove last updated (CHANged) date from exported GEDCOM
I've just redone my tests of 17 Aug 2014 16:26 with a few extra tweaks like remove record flags, file root,named list, source type.
Everything worked as expected and the error re
Looking even better!
Everything worked as expected and the error re
- 1 NOTE note
is changed to
2 CONT note
Looking even better!
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68