Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › MLP to Batch › Reply To: MLP to Batch
Out of the string “x0d x1c x0d x0b “, you only wnat to get rid of “x1c x0d x0b “. The first x0d is the termination character for the last segment of the previous message. You need to keep it.
Also there will be “x1cx0d” at the end of the last message but no “x0b” and there is a “x0b” before the first message without the other stuff.
I would do it in two steps
Try this:
# Get rid of all x1c and x0b
regsub -all — {[x1cx0b]} $msg {} msg
# Replace two carriage returns with carriage return line feed
regsub -all — {rr} $msg “rn” msg
Note the rn replacement string is *NOT* inside curly braces since it must be evaluated as a carriage return and newline by Tcl
Good luck with it