Home Page list
TMG-RootsMagic Split Citation Details #tmg #citations #sourcetemplates RootsMagic 126.96.36.199 imports TMG Citation Detail memo field into CitationTable.Fields as the field [CD] defined in the SourceTemplateTable.Fields regardless of TMG memo splitter "||". An issue which I'm sure many will detect is that sentences for sources with split Citation Detail (CD1, CD2,..) do not contain any of the Citation Detail. The full value is there in the [CD] field but the sentence templates use [CD1] etc, not [CD]. A fix is to manually edit the Source Template sentence templates to use [CD] in the sentences - there are only 3 or 4 such source templates in the Sample Project - however that changes the order and lengthens the Short Footnote and the || separator remains in the output. A much better result is to add [CD1] et al fields to the source template field definitions and then edit each citation to separate the pieces out of [CD] into the new fields. Unfortunately, every citation needs to be edited - for some users this may number in the thousands or even tens of thousands.
I'm hopeful that the RootsMagician will find the resources to automate this parsing and mapping on import. Meanwhile, here is a SQLite procedure which does the job for those Citations having footnote sentences using [CD1] and [CD2], the most common case where the Citation Detail memo is split into two parts. It splits and replaces [CD] in CitationTable.Fields into the two parts [CD1] and [CD2]. It splits and replaces Citation Detail [CD] in the fields definition in SourceTemplateTable.Fields for the source templates used by these citations. NEW! Script now handles up to CD9...2014-09-30.
|Citation imported from TMG before running the query. Note the absence of any Citation Detail content in the preview of the Footnote, Short Footnote sentences and the "||" splitter in the Citation Detail value.|
|After running the query, the sentences contain the values from the split Citation Detail, now replaced by [CD1] and [CD2].|
This query needs the REGEXP function available in SQLiteSpy. but not in SQLite Expert Personal.
As usual, backup first
. Be sure to inspect for adverse effects; I have checked various combinations but, obviously, cannot anticipate all the possible variations that can arise from many different users.