Find records only containing a subset of text
I have a number of records with a field that contains the same text, but some have additional text, such as the following (each line here represents a different record for this field):
What I need to do is search for all of the records that only contain "sometext" and replace them all with "additionaltext sometext." When I use the "find/replace" feature to search for "sometext" it includes all of the above records, so records with "additionaltext sometext" will be changed to "additionaltext additionaltext sometext," which is an undesired result.
It would be great if there was a way to have the find/replace feature be specific to find fields that contain ONLY the specified text, and then have an option to replace the contents of those fields.
I can do this by first searching and then replacing the contents for all found fields; however, in my case i have about 5000 records, with about 400-500 different combinations of "sometext" and "additionaltext sometext" so I would have to do about 400-500 sortings to update all the data the way I want.
In trying to avoid this tedious endeavor, are there any suggestions for how to go about scripting or otherwise automating this? Basically, I need to loop through all of my records with the logic: if "sometext" only, then replace with "additionaltext sometext" and do this for all variants of "sometext."