| 1 |
/* |
| 2 |
* @progname fix_nameplac.ll |
| 3 |
* @version 1 |
| 4 |
* @author Eggert |
| 5 |
* @category |
| 6 |
* @output GEDCOM |
| 7 |
* @description |
| 8 |
|
| 9 |
This is a quicky to show how to fix name and place spacing. |
| 10 |
|
| 11 |
|
| 12 |
fix_nameplac - a LifeLines names and places fixing program |
| 13 |
by Jim Eggert ([email protected]) |
| 14 |
Version 1, 8 January 1993 |
| 15 |
|
| 16 |
|
| 17 |
*/ |
| 18 |
|
| 19 |
proc fixit(root) { |
| 20 |
list(components) |
| 21 |
traverse(root,node,level) { |
| 22 |
set(t,save(tag(node))) |
| 23 |
d(level) " " t " " |
| 24 |
if (not(strcmp(t,"PLAC"))) { |
| 25 |
extractplaces(node,components,nplaces) |
| 26 |
forlist(components,place,plnum) { |
| 27 |
if (gt(plnum,1)) { ", " } |
| 28 |
place |
| 29 |
} |
| 30 |
} |
| 31 |
elsif (not(strcmp(t,"NAME"))) { |
| 32 |
extractnames(node,components,nnames,nsurname) |
| 33 |
forlist(components,name,nnum) { |
| 34 |
if (gt(nnum,1)) { " " } |
| 35 |
if (eq(nnum,nsurname)) { "/" } |
| 36 |
name |
| 37 |
if (eq(nnum,nsurname)) { "/" } |
| 38 |
} |
| 39 |
} |
| 40 |
else { |
| 41 |
value(node) |
| 42 |
} |
| 43 |
"\n" |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
proc main() { |
| 49 |
forindi(person,pnum) { |
| 50 |
call fixit(inode(person)) |
| 51 |
} |
| 52 |
forfam(family,fnum) { |
| 53 |
call fixit(fnode(family)) |
| 54 |
} |
| 55 |
"0 TRLR\n" |
| 56 |
} |