A GEDCOM is plain text, which means most of what goes wrong with one can be fixed in a text editor. Here are the common ones.

Work on a copy. Keep the original.

"Cannot process line 1" or "expected 0 HEAD"

If the first line looks like 0 HEAD, those three characters are a byte order mark: a UTF-8 signature that some programs write and some readers choke on. GED-VIEW ignores it. If another program refuses the file, delete those characters so the line starts with 0 HEAD, and save as UTF-8 without BOM (most editors have that option in Save As).

Blank lines

The GEDCOM standard does not allow empty lines, and some strict readers stop at the first one. They usually come from hand editing or from a note that contained a blank paragraph. Search for two line breaks in a row and remove one. In a note, replace the blank line with a 2 CONT line so the paragraph break survives.

Lines with no level number

Every line starts with a number: 0 for a record, 1 for something inside it, 2 for something inside that. A line that starts with text instead usually means a long note was pasted in without being split properly. Prefix each stray line with the right level and the tag CONT:

1 NOTE This is the first line of a long note
2 CONT and this is the second
2 CONT and this is the third

CONC and CONT confusion

Older files (5.5.1) split long text across lines using CONC (join with no space) and CONT (join with a new line). If a program wrote them wrongly, words run together or lines break mid-sentence. There is no clean automatic fix; if it matters, re-export from the source program. GEDCOM 7 removed CONC for exactly this reason.

Duplicate IDs

Every record has an identifier like @I42@ and it should be unique. Pasting one file into another produces duplicates, and readers then link facts to the wrong person. One of the two needs a new number, and every reference to it in the file needs to change to match. That is search and replace, carefully, or better, a program that merges properly. Do not do it by hand on a large file.

References to records that do not exist

A citation pointing at @S99@ when there is no @S99@ record. Usually left over from a partial export. GED-VIEW loads the file, shows the citation as unresolved, and reports how many there were. It is safe to leave. Delete the pointer line or re-export if it bothers you.

Missing 0 TRLR

The last line should be 0 TRLR. If it is missing the file was truncated. Add the line and the file will load, minus whatever was cut off.

When to give up on the editor

If there are hundreds of problems, or the file is very large, editing by hand is a mistake. Re-export from the program that made it, with the settings from the relevant export guide. Nearly every corrupted GEDCOM was made by an old version of a program that has since fixed the bug.

Next

Check the first line and the last line of the file. Those two catch most of it.