This Python program rectifies the numbering of examples in OpenOffice linguistic papers, and keeps references to examples coordinated. The program assumes that all example numbers start on the left edge of a line, and that all references to examples are preceded by a space. The program allows forward references but only to the very next example. For backward references where there is more than one example with the same number it assumes that the reference is to the most recent one with that number. The program assumes that the paper has less than 1000 examples.
Please contact me via e-mail at: edwinprinceton.edu and I will send you the code for this program.
To use the program, open X.odt as though it were X.zip (maybe rename X.odt as X.odt.zip), extract 'content.xml' from it; apply this program to content.xml ('python renumber.py content.xml'), then reinsert content.xml into X.odt, overwriting the original. Save a copy of the original X.odt as things might go bad.