* How to Fix GEDCOM Notes problems with Generations

News and Announcements from the Family Historian World
Post Reply
avatar
admin
Famous
Posts: 245
Joined: 30 Aug 2013 07:52
Family Historian: V6
Contact:

How to Fix GEDCOM Notes problems with Generations

Post by admin » 16 Nov 2002 20:52

Date: Fri, 23 Aug 2002 11:32:09 +0100
Peter Bolson mentioned the problem he has with Notes records generated by Generations version 6.0. He sent me an example of it. The problem in a nutshell is that this version of Generations is generating invalid and incorrect GEDCOM for Notes records. It appears that they fixed this bug in later versions, but that doesn't help version 6.0 owners. The best solution is to find someone who has a later version of Generations who can open your Generations files and do the export for you. However, if you don't know anyone with a later version of Generations, here is an alternative solution (not for the faint-hearted):
The problem is sufficiently severe that the only way to solve it is to edit the GEDCOM file itself directly. You can do this using a text editor such as Notepad or Wordpad. For the purposes of this example, you need a text editor which lets you do Search/Replace, which Wordpad does, and Notepad doesn't. So use Wordpad if you don't have anything better (Wordpad is a free accessory that comes with Windows). Bear in mind that GEDCOM files are text files so you can use any text editor you want (as long as it can cope with the file size).
Before trying this, here are 3 thoughts: (A) PLEASE make sure you make a backup copy of your file before you try changing it in a text editor!!!! (B) The instructions are fairly detailed, but on the whole make it seem more complex than it is. However, its probably not worth attempting unless you are at least reasonably self-confident about it, know how to select multiple lines in a text file, know what 'Cut', 'copy' and 'paste' mean, and can make sense of the instructions! (C) This is all 'at your own risk'. If you make a mess of it, and haven't kept safe copies of your original files, please don't complain to me about it.
Now, suppose you have a note record with text that reads: 'I was born in the year 1632, in the city of York, of a good family, though not of that country, my father being a foreigner of Bremen, who settled first at Hull.' When you save this to GEDCOM it should be saved in a format that looks like this:
0 @N1@ NOTE I was born in the year 1632, in the city of York, of a good family, though not of that coun 1 CONC try, my father being a foreigner of Bremen, who settled first at Hull.
GEDCOM lines always begin with a number. Records (e.g. Note records) always start with a 0. Other lines have numbers that are bigger than 0. These lines are all parts of records. Long notes have to be split over several GEDCOM lines, because GEDCOM lines must not be longer than 255 characters (actually this particular note could fit onto one line, but I've split it over 2 to illustrate how that works).
The problem is that Generations version 6.0 would not generate the correct GEDCOM. Instead it would produce something like the following for this note:
0 @N1@ NOTE 1 NOTE I was born in the year 1632, in the city of York, of a good family, though not of that coun 2 CONC try, my father being a foreigner of Bremen, who settled first at Hull.
Which, in computing terms, is nothing like what it should be.
So - what you need to do is this:
*** Tips if you use Wordpad *** i) You will need to set the File type to 'All documents' in the File Open dialog, to see GEDCOM files. ii) Make sure you set the Wordwrap option to 'No wrap' (View/Options menu, then Text tab). iii) Create the New File as a 'Text document' in Step (3). iv) When you save the file, make sure you save it as a 'Text document' v) When searching for '1 NOTE' in step (5), press F3 to repeat the last search **************************
(1) Locate the section of your file that contains the Note records. Note records (like all records) occur on lines that start with a 0. They are followed by an @ char, then a letter 'N', then a number, another @ char, then the word NOTE (e.g. 0 @N1@ NOTE). A Note record ends where the next record starts (ie. at the next line that starts with a 0). (2) Select all the lines that belong to Note records (all Note records should be grouped together) and use Cut to move them into the clipboard. Type a new line with just 3 asterisks in it, to show where the Note records had been. Save the file. (3) Create a new file and paste the Note records into it. (4) In the new text file, use your editors Search and Replace facility to change all occurrences of the text '2 CONC' to '1 CONC' (use Match Case for greater safety). Also similarly change all occurrences of '2 CONT' to '1 CONT'. (5) Search for all occurrences of '1 NOTE'. You will have to change each of these manually. They will be preceded by a line that starts with a 0. e.g.
0 @N1@ NOTE 1 NOTE I was born in the year 1632, in the city of York, of a good family, though not of that coun
You need to make these 2 lines into 1 line by deleting everying following the start of the word NOTE on the 1st line up to the start of the word NOTE on the 2nd line. So that this example would become.
0 @N1@ NOTE I was born in the year 1632, in the city of York, of a good family, though not of that coun
Theoretically doing this might mean that the new line was now over the 255 character limit, if the 2nd line was exactly 255 characters long. However, in practice Generations appears to keep its lines much shorter than that, so I don't think this should be a problem.
(6) finally, select all of the text in the new file. Copy it to the clipboard. (7) Re-open your original file. Locate the line with 3 asterisks and delete that line. (8) Place your cursor at the start of the next line and click Paste. (9) Make sure that the line you used in (8) is still a separate line, and hasn't got appended to the end of a Note record line. If it has, add a line break (use the Enter key) to put it back on a line of its own. (10) Save your changes. (11) Open the file in Family Historian and check it *very carefully* to see if it now looks OK! Try looking at your Note records in the Property Dialog to make sure that everything is exactly as it should be.
Bearing in mind that you can use 'Replace All' to do all the replacements in step (4) in one go, this shouldn't necessarily take as long as you might think. The longer bit is step (5) where you have to manually merge 2 lines for each note record. How long that would take would depend on how many Note records you have.
Incidentally, if you don't have many Note records, and you happen to know that CONT and CONC only ever occur within Note records and nowhere else, then you could do steps (4) and (5) on the original file without ever having to go to the trouble of first isolating the Note records by cutting and pasting them into another file.
*** FINAL NOTE: this version of Generations also uses CONC incorrectly everywhere - which means that you will always lose a space character wherever you see a CONC, and 2 words will be fused together with no space between them. This is a less serious, but nevertheless very annoying problem. The GEDCOM spec says that you must never split a line (using CONC) at a space character, and this version of Generations only ever splits lines at space characters using CONC. If you wanted to, you could go some way to solving this problem by modifying your search/replace in step (4) to replace '2 CONC ' with '1 CONC _' (there is one space after the CONC in each case). This way, you will get an underscore character wherever you should have a space, making the missing space characters easier to locate later, and making the text easier to read.
Good luck.
Simon Orde List Administrator and Family Historian designer
Part 2
Subject: Re. How to Fix GEDCOM Notes problems with Generations 6.0
Date: Fri, 23 Aug 2002 11:48:20 +0100 P.S.
In the previous email there are several lines which should appear as a single line, but which have been automatically split (by my email program) over 2 lines. For example,
0 @N1@ NOTE I was born in the year 1632, in the city of York, of a good family, though not of that coun
should be one GEDCOM line, and was originally written by me as one line, but got split by the email program over 2. All the examples of GEDCOM lines are like this. Whenever you see a GEDCOM line, bear in mind that it should always start with a number (e.g. 0, 1, 2, etc) and mentally put it back onto a single line as you read it. Sorry about that.
Simon Orde List Administrator and Family Historian designer

avatar
aloysius
Newbie
Posts: 1
Joined: 19 Nov 2003 14:47
Family Historian: None

How to Fix GEDCOM Notes problems with Generations

Post by aloysius » 20 Nov 2003 08:59

As a new user, I hope that I am not just going over old ground.

I have just bought Family Historian and have had to transfer my files from Generations 5.2 (Yes, I know that this is a very old version but there may be other primitives out there like me).

This entailed using the very helpful posting on 23 Aug 2002 11:32:09 +0100 detailing how to handle transfer from Generations 6.0 with two modifications, as follows.

Generations 5.2 includes a field that is labelled 'memo' which is attached to other fields such as 'birth', 'baptism', etc. This field is included in the exported gedcom file within the individuals' records in lines which start with '2 NOTE'.

This must be changed to '2 SOUR' to successfully import the contents of the Generations memo fields into the appropriate sources fields within Family Historian. This can be done by a modification of stage (2) of the Aug 2002 procedure - as follows (modification in square brackets):

'(2) Select all the lines that belong to Note records (all Note records should be grouped together) and use Cut to move them into the clipboard. Type a new line with just 3 asterisks in it, to show where the Note records had been. [Then, using the 'find and replace' function in your word processor, find all occurrences of '2 NOTE' and replace them with '2 SOUR'.] Save the file.'

Then continue with stage (3) etc of the Aug 2002 procedure.

Stage (5) of the Aug 2002 procedure can also be improved on by most word processors in that the amendment can be made automatically using 'find and replace' rather than carrying out the modifications manually on at a time. For example, using Lotus WordPro, the 'find expression' is 'NOTE^R1 ' (ignoring the quotation marks) and the 'replace' expression is '' (again, ignoring the quotation marks - i.e. nothing. In other words 'NOTE^R1' is being replaced by nothing with the result that 'NOTE' then the 'end of paragraph' marker(^R)* and then the '1' and the following space on the next line are all deleted. This will result in a change from:

'0 @N1@ NOTE
1 NOTE I was born in the year 1632, in ... etc'

to

'0 @N1@ NOTE I was born in the year 1632, in ... etc'

*N.B. The end of paragrah marker will probably be of a different form in other word processors.

I hope that this is helpful.

Mike Walton.

Post Reply