Logo Home    Page list

TMG-RM Fact Sentence Tweaks #tmg #facttypes #roles #events #sharedevent

After importing a TMG project, there is considerable cleanup to be done in the resulting RootsMagic database. There are differences in their respective sentence template languages that cannot translate well or could be translated better (improvement possible in the direct import process). This script addresses some of these outcomes and some unwanted artifacts that could have more to do with the TMG user's style in customizing sentences in TMG. There are very likely more common problems that could be ameliorated by extensions to the script; post suggestions as comments on this page.

There are limits to what can be done within SQLite because it lacks regular expression search and replace within a field. A higher level language using a SQLite connection is required to go beyond SQLite's own limitations. This script does use the REGEXP extension to find records having a field value that matches a regular expression but the REPLACE() function does not support regex for its search and replace, not even a wild card character; only explicit strings can be used as parameters.

The script processes all sentences associated with facts/events in RootsMagic:

The functions performed include:

TMG-RM_Sentence_Tweaks.sql N.B. Requires a SQLite manager such as SQLiteSpy that supports the REGEXP extension; SQLite Expert Personal does not.

The script is not restricted solely to be used on databases imported from TMG. It may help with other databases, too. The caveat is that it, too, may have some unwanted results so it is important to keep the original and compare it to the tweaked one to conclude whether the benefits outweigh the collateral damage.