So I am trying to match the following string in an RTF document:
{*bkmkend InsertPictureHere}
Then I want to build a long replace statement as follows, based on facility:
# Build find/replace strings to insert logo path
set find “{\*\bkmkend InsertPictureHere}”
echo FIND: $find
set replace “{\field {\*\fldinst {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 INCLUDEPICTURE “
#set replace2 according to facility
if {$sendFac == “A”} {
set replace2 “”G:\SHARED\DRBitmaps\SARMC.tif””
}
if [regexp — {84|269|211|5399} $recvFac] {
set replace2 “”G:\SHARED\DRBitmaps\IMI.tif””
}
if {$sendFac == “TMC”} {
set replace2 “”G:\SHARED\DRBitmaps\TAMjoi01.tif””
}
set replace3 ” \\* MERGEFORMAT \\d }} {\fldrslt {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 }}} {\*\bkmkend InsertPictureHere}”
append replace $replace2 $replace3
echo REPLACE: $replace
#regsub -all — $find $report $replace report
regsub -all — $find $report $replace report
I am not able to match {*bkmkend InsertPictureHere} in my report. I tried {*bkmkendsInsertPictureHere}, also.
Also, once I figure out my match problem, will a regsub work ok when I’m using so many variables?
Any ideas what could be happening?
Thanks in advnace