Search and Replace Question

Using RM9 v., iMac, Sonoma 14.1.2.

I would like to change one word that I have consistently used within the body of my Footnotes, Short Footnotes and Citations.

In Sources, I go to “Search and replace.” In “Fields to search” I enter “Sources-Actual text.” I then enter the word I want to replace in “Search for” and the new word in “Replace with” and check “Match case.” The result is a window with “No more matches found” and upon closing that window, another window pops up with “No matches found.” I have also tried this without checking the “Match case" and get the same result. Yet I have 708 sources in this file that contain the word that needs to be replaced.

Is this a bug or am I doing something wrong?

Search and Replace is severely limited in what it can replace. The Source fields for choice are these three:
Screenshot 2023-12-10 145821
Find Everywhere search block in upper right corner will find and list what you seek. Then you can click on the blue field names to goto each individually for editing purposes.

Ouch, that’s disappointing!

Looks like I have some work to do…will try a feature request.

Thank you, Kevin.

1 Like

I’m only guessing, but since the Footnote, Short Footnote, and Bibliography are typically “synthesized ̶d̶o̶w̶n̶” ̶s̶h̶o̶r̶t̶e̶r̶ derivatives (of, and referential to, the Source Name) that will appear as entered both onscreen and in reports… they should be protected against change independently, because unless done “en masse” (including Source Name), they might no longer reflect the intended purpose. On the other hand, the Source Name is not shown onscreen or in other program output, so (after the fact) changing the Source Name is only going to look odd (as a mismatch from the Footnote, Short Footnote, and Bibliography contents) when navigating the Long Ol’ List on the Sources window!

EDITED: struck through a couple words that would not necessarily be applicable, moved parentheses, expanded LOL

@kbens0n I don’t understand your comment. One sentence seems to contradict the other. And isn’t it the Source Name that is derived?

Not sure what you mean.

The Source Name is contrived by the user to help them get back to it in the list of sources, the others are typically derivative in the sense that… after the user has named the source, they typical enter into the other fields a set of formatted representations that correlate with the naming scheme contrived to appear in that listing of sources. If it’s the 1950 Census, the Source Name is gonna likely contain that vernacular and so are the footnotes/bibliography.

I’m a bit confused by this thread, but I’m pretty sure that the answer is that RM doesn’t support replacing data in the field where you need to replace the data. As kbens0n mentioned, Search and Replace is severely limited in what it can replace.

The “Sources-Actual text” field that is mentioned in Search and Replace is the same field that is called “Master Source text, media, etc. => Source Text” in the RM’s Edit Person screen. Based on your description of the problem, that almost certainly is not the field that contains the one word you need to replace.

I don’t think the source name has much if anything to do with this problem. The problem is in the Footnotes, Short Footnotes, and Citations. So before we go any further, let me ask if you are using RM’s free form source template or are you using one of RM’s built-in source templates? In other words, exactly which source template are you using? And exactly where in the source templates did you enter the word which you now need to replace? In other words, if you were to fix this problem one citation at a time, exactly where in RM would you be making the correction?

1st sentence: “the Source Name (that will appear as entered both onscreen and in reports)”
2nd sentence: “the Source Name is not shown onscreen or in other program output,”

And what does this mean?: “when navigating the LOL !”

I see what you mean but I come at it the other way around. Decide first on how I parse between master source fields and citation fields, enter data therein and then make final the respective Names. That’s why I think the Names are derived and are metadata about or for the data.

Parentheses in the wrong place ~ “I’m only guessing, but since the Footnote, Short Footnote, and Bibliography are typically “synthesized ̶d̶o̶w̶n̶” ̶s̶h̶o̶r̶t̶e̶r̶ derivatives (of, and referential to, the Source Name) that will appear as entered both onscreen and in reports… they should be protected against change …”

since~Footnote, Short Footnote, and Bibliography~ARE~derivatives~that~WILL~appear

the Long Ol’ List

1 Like

Even with the correction, I think this is backwards about the Source Name. The Footnote, Short Footnote, and Bibliography are not derivatives. It is the Source Name that is derivative.

In the case of the free form source template, you type in the Footnote, Short Footnote, and Bibliography directly. In the case of using one of RM’s source templates, the Footnote, Short Footnote, and Bibliography you type in Footnote, Short Footnote, and Bibliography indirectly by typing data fields into the template. I suppose you could call this “derivative”, but it’s a very different process than RM9 uses to create a default Source Name. If you change the data in the data fields, the Footnote, Short Footnote, and Bibliography change immediately to match precisely with the changed data in the data fields. The Source Name does not adapt similarly, nor should it. That’s because you can make the Source Name be anything you wish and RM9 only derives an initial default for the Source Name for the data fields. Nothing whatsoever is derived in return from the Source Name if it is changed.

RM’s Advanced Search and RM’s Find Everywhere will find data that’s in Footnotes, Short Footnotes, and Bibliography field, no matter whether you are using the free form source template or one of RM’s actual source templates. In the case of the actual templates, Advanced Search and Search Everywhere search on the Footnotes, Short Footnotes, and Bibliography after they are constructed by the templates.

RM’s Search and Replace will not search and replace data that’s in Footnotes, Short Footnotes, and Bibliography. Doing so would be trivial if there were no actual source templates and if RM only supported the free form template. Doing so for sources using the actual source templates would be very difficult, close to impossible in the most general case. That’s because character strings you might Search in the final Footnote, Short Footnote, and Bibliography might be composed by the template from several different data fields in the template.

About the only way it could work would be if you could Search and Replace by the field names in the template. I’m talking about fields such as [CensusID] and [PageID] for the census templates, etc. I’m pretty sure that’s where the data you need to Search and Replace has been typed into RM.

Jerry, thank you for jumping in. You are correct, the source name isn’t the problem.

I create my own footnotes using RM’s free form source template. The word I want to replace is located within the footnote, short footnote and thus the citation. Without “Search and replace” to fix this problem, I would need to open every source, then open its footnote, short footnote and citation to make the correction.

That is correct.

At the present time, the only way to make this correction all in one go would be with an SQLite script. Potentially, it would be a trivial script, but it would require programming skills to install an SQLite manager and to run the script. Also, RM recommends against running SQLite scripts and they cannot provide technical support for problems created by running SQLite scripts that might have damaged your database.

The reason I used the word “potentially” along with the word “trivial” is that it would be a trivial script to replace your one character string with your alternate character string for every citation in your database. But if your one character string might appear validly in some other citations, then the script might need to do some parsing of your citations. That would not be so trivial at all.

That is a fairly easy task using an outboard SQLite query of the database. As Jerry says, doing so for templated sources is more complex but still easily done for single words that occur once in a generated sentence; phrases could be a very different matter depending on whether they comprise multiple data fields or linking words from the sentence template or variable definition.

Thank you Jerry and Tom for your responses. Since I have zero programming skills I will be doing this the long way—one at a time. :frowning:

Hopefully “Search and Replace” can and will be expanded. As Kevin said, as it stands, it’s severely limited!

Search and Replace: Source, Actual Text is the Master Source, Source Text field. You can find text that you need to manually change by using Find Everywhere.

Yes, thank you, that was suggested before by Kevin. However, I really don’t need to “find” the word, I know where they are, it’s in every source footnote and citation in this file consisting of 708 sources. I just need to “replace” the word and an expanded “Search and Replace” would have made that a lot easier than manually changing 708 footnotes and citations!

1 Like

It occurs to me that there might be a low tech solution. Namely, export your entire RM database as a GEDCOM file, use a text editor to change your one word as needed throughout the GEDCOM file, and then import the GEDCOM file into a new and empty RM database. You should be able to do a global search and replace with a text editor, correcting all 708 occurences of your word all in one go.

I’m usually reluctant to suggest this kind of a solution because there are potential data losses associated with exporting and importing RM’s GEDCOM. See GEDCOM & DnD transfer losses #gedcom for more information. But in this case, your data losses might be minimal to non-existent.

If you choose to go this route, be sure to turn on the “GEDCOM export” option for all your fact types and be sure to include all the data options you can in the GEDCOM export dialog. Then in the GEDCOM import dialog, be sure to turn on the Preserve Record Numbers option. The Preserve Record Numbers option is only available when you are creating a new RM database from GEDCOM. It is not available when you are importing GEDCOM into an existing database.

Just imagine how easy this would be if RM allowed their users to write add-ons that could handle the majority of all the posts in this forum. At least one of their competitors does. The add-ons are available on their official website, which means the gene software author has taken the time to test them before making them available. But I’m not sure how much free time Bruce has to bring something like this to fruition.

1 Like

I have thought about this for years. One aspect of it might be quite easy. Somewhere on the official SQLite site (not Tom Holden’s SQLite site for RM) there is a sample C++ program that simply opens a Window, takes in an SQLite query, runs it, and displays the query results in the window. It’s almost like a very primitive SQLite manager, and it’s a very short and simple program. Something like that shouldn’t be especially hard to do in RM.

But there are hard parts.

  • The RM staff time to validate the scripts before making them public would surely be overwhelming
  • Decisions would have to be made about scripts that are query only vs. scripts that perform updates. Scripts that update data fields might be some of the most useful, like the one needed here in this thread to change one word in the data fields of hundreds of citations. Allowing scripts that update data fields would require even more RM staff time for validation than scripts that are query only and such scripts could be fraught even after validation.

One of their competitors (who I am not naming so that the forum admins don’t think I’m advertising for them) does it and the product is written by a single author. It’s also a pretty solid program that doesn’t require a bunch of bug smashing. So, it can be done.