I am beginning a new project and attempting to use BBEdit prepare a data set for input into a database. For the first step, I would like to add a string to each text entry in all caps that does not have a first name after it. For example, using the sample from the data set below, I would like to transform the entry “ABBOTT” into “ABBOTT, UNKNOWN”
ABBOTT, EDWARD (c.1737–91), painter, of Long Acre, London; according to Redgrave, he travelled in France and Italy with the engraver William Wynne Ryland, i.e. c.1760; see Ryland.
ABBOTT, JOHN, merchant; see Francis Harriman
ABBOTT
1763 Naples (31 Dec.; Martin jnl.MSS)
I am able to search for each entry in all caps that is not followed by a first name using this GREP formula: ^[[:upper:]]+$
For the life of me, I cannot figure out how to use the REPLACE function to retain the original text and append a string. (e.g. to transform “ABBOTT” into “ABBOTT, UNKNOWN”)
I’m sure it’s a really simple thing that I’m missing, but I have been trouble finding a solution online.
I appreciate any help from this list. Thanks.