Wildcard substring replacement?

Does anyone have an simple way of resolving the following?

I have a large db with a field called GenComments (>65K docs). In some docs the field has embedded in it a string “<BRN” followed by a 1 to 5 digit number, followed by “>”. So it might be “Here is some text and here is some more text (ad infinitim)”. I’d like to remove all the <BRN???> from the field and replace it with a “”. Am I just losing it or is this something that is going to require looping 99,999 times to do the @replacesubstring?

Subject: Wildcard substring replacement ??

Is GenComments a rich text field? If not, you will probably have to do what you suggest. If it is a rich text field, and if a third party product is an option, you could use our Midas Rich Text LSX and the code would be something like:

Call rtitem.ConnectBackend(doc.Handle, “GenComments”)

Set rtchunk = rtitem.DefineChunk(“Everything”)

rtchunk.TextWildcards = True

Call rtchunk.ReplaceText(“<BRN*>”, “”)

rtitem.Save

If GenComments is a rich text field and a third party product is out of the question, you might want to look into exporting to DXL and processing there. The Notes rich text classes are not robust enough to handle this, imho, and the @ReplaceSubstring method would lose all formatting and richnexx for your rich text.

Subject: Wildcard substring replacement ??

Hello,

you do not need to loop 100k times… LOL!

Just use @Middle to retrieve whats betweeen the “<” and “>”. Then use this value plus the “<, >” to do the @replacesubstring. HTH.

Cheers,

Mark