I have fixed the ‘escape’ character as request. Now, the entire line is being eliminated, not just changing the .br to a tilde. The log looks like:
{History: Age: 28 years. LMP not sure. Conception: spontaneous..br____________________________________________________________________________.brDating:.brConception Date: 09/01/2009 EDC: 05/25/2010 GA by Conception: 13w0d.br____________________________________________________________________________.brFirst Trimester Scan:
.brSingleton gestation..brFetal Anatomy:.brSkull / Brain: appears normal. Spine: appears normal. Heart: appears normal. Abdomen: appears normal. Stomach: not examined. Bladder: not examined. Hands: both visible. Feet: both visible. Cardiac abnormality. .br .brFetal heart activity: present. Fetal heart rate: 125 bpm. .brAmniotic fluid: normal. AFI
60.0 cm. .brPlacenta: anterior-low lying. Placenta accreta. .br\.br____________________________________________________________________________.brReport Summary:.brImpression: Type something there. Yes. .br\.brRecommendations: Continue to monitor patient}
W variable is: .br
Y variable is: ~
I added the echo of the W and Y variable just to see if those were set correctly.
proc br_to_tilde {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
echo $xlateInVals
set $xlateOutVals $xlateInVals
set result [regexp {\.br\} $xlateInVals match]
if {$result >=0} {
set var $xlateInVals
set x “\.br\”
set w $x
set y “~”
set var [string map
$var]
set xlateOutVals $var
echo “W variable is:” $w
echo “Y variable is:” $y
}
}