Greg Cooke wondered: > Is there a way to create a list/report of embedded citations? Hi, Greg, You could use a TMG List of Events report to find these events and output such memos. I would use a filter of: Memo || Contains || CIT: || END I would probably have output columns of Prin1 ID, Tag Type Label, and Memo for that LOE report. It should be easy to identify the people with such memos from such a report. You could even use the Secondary Output to set a Flag to mark these people. While that report will output the "entire" memo, if the report went to a Comma Separated Value (CSV) file, you could manipulate the Memo field separately in a Spreadsheet to extract only what was inside the embedded citation brackets. For example, in Excel a combination of the SEARCH and MID text functions will do the extraction of the contents of the embedded citation. Assume column A has the Memo text, then an empty Column (e.g. D) would contain a text formula to do the extraction. For example, for D1 the formula would be: =MID(A1,(SEARCH("[CIT:]",A1)+6),(SEARCH("[:CIT]",A1)-SEARCH("[CIT:]",A1)-6)) Then copy that formula down the D column for all the rows where A has memo text. This D column would now contain only what is inside the embedded citation markers. Now you could sort on Column D to identify all the source numbers. Hope this gives you ideas, Michael
Thanks Mike, I ended up using a Word macro on the TMGU output. There were multiple embeds within a given memo, and the memos were quite large--the entire log file was over 100 pgs when I copied it to Word, and that was only 59 memos with embeds. Here's the macro if anyone has a use for it: Dim firstTerm As String Dim secondTerm As String Dim myRange As Range Dim documentText As String Dim startPos As Long 'Stores the starting position of firstTerm Dim stopPos As Long 'Stores the starting position of secondTerm based on first term's location Dim nextPosition As Long 'The next position to search for the firstTerm Dim ctr As Integer nextPosition = 1 'First and Second terms firstTerm = "[CIT:]" secondTerm = "[:CIT]" 'Get all the document text and store it in a variable. Set myRange = ActiveDocument.Range 'Maximum limit of a string is 2 billion characters. 'So, hopefully your document is not bigger than that. However, expect declining performance based on how big document is documentText = myRange.Text 'Loop documentText till you can't find any more matching "terms" Do Until nextPosition = 0 startPos = InStr(nextPosition, documentText, firstTerm, vbTextCompare) stopPos = InStr(startPos, documentText, secondTerm, vbTextCompare) 'Write the citations sequentially, starting with where ever you left the cursor Selection.InsertAfter Mid$(documentText, startPos + Len(firstTerm), stopPos - startPos - Len(secondTerm)) & vbCrLf nextPosition = InStr(stopPos, documentText, firstTerm, vbTextCompare) Loop MsgBox "I'm done" Next step is to Flag those sources so I don't inadvertently orphan some embedded citations Thanks Greg On Wed, Sep 2, 2015 at 12:20 PM, Michael J. Hannah via <tmg@rootsweb.com> wrote: > Greg Cooke wondered: >> Is there a way to create a list/report of embedded citations? > > Hi, Greg, > > You could use a TMG List of Events report to find these events and > output such memos. > I would use a filter of: > Memo || Contains || CIT: || END > > I would probably have output columns of Prin1 ID, Tag Type Label, and > Memo for that LOE report. It should be easy to identify the people with > such memos from such a report. You could even use the Secondary Output > to set a Flag to mark these people. > > While that report will output the "entire" memo, if the report went to a > Comma Separated Value (CSV) file, you could manipulate the Memo field > separately in a Spreadsheet to extract only what was inside the embedded > citation brackets. > > For example, in Excel a combination of the SEARCH and MID text functions > will do the extraction of the contents of the embedded citation. > > Assume column A has the Memo text, then an empty Column (e.g. D) would > contain a text formula to do the extraction. For example, for D1 the > formula would be: > > =MID(A1,(SEARCH("[CIT:]",A1)+6),(SEARCH("[:CIT]",A1)-SEARCH("[CIT:]",A1)-6)) > > Then copy that formula down the D column for all the rows where A has > memo text. This D column would now contain only what is inside the > embedded citation markers. > > Now you could sort on Column D to identify all the source numbers. > > Hope this gives you ideas, > > Michael > The TMG archive is found here: http://archiver.rootsweb.ancestry.com/th/index/TMG/ > Instructions on how to subscribe to TMG: http://lists.rootsweb.ancestry.com/index/other/Software/TMG.html > ------------------------------- > To unsubscribe from the list, please send an email to TMG-request@rootsweb.com with the word 'unsubscribe' without the quotes in the subject and the body of the message