I have a message in the following format:
Segment [0D0A]
Segment [0D0A]
Segment [0D0A]
Segment [0D0A]
that I’m trying to run a pre-processor against using regsub to get the following output:
Segment [0D]
Segment [0D]
Segment [0D]
Segment [0D]
I’m using the following script, but for some reason when it translates the message it replaces the 0D0A with a space. This makes me think its identifying it correctly, but not performing the replace. I even tried changing the string that was supposed to be the text inserted to “TESTTEXT” just to see if I had indicated the special character incorrectly but this didn’t seem to help.
I’m sure I’m overlooking something simple.
proc tpsConvertCRLFToLF { args } {
set argList [keylget args ARGS]
keylget args MODE mode ;# Fetch mode
switch -exact — $mode {
run {
set msgID [keylget args MSGID]
set msgText [msgget $msgID]
regsub -all {rn} $msgText {r} msgText
msgset $msgID [join $newmsg]
return “{CONTINUE $msgID}”
}
default {
error “Unknown mode ‘$mode’ in tpsMessageFilter.”
}
}
}