› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Removing a }
regsub -all {\|/|-|.|}} $xlateInVals “” xlateOutVals
Can someone help me with the code to remove a }? Thanks.
For example
set replList
set str “1\2/3-4.5}6”
set newstr [string map $replList $str]
echo $newstr
123456
In most cases the string map command is much faster plus you don’t have to escape as much.
proc xlt_name {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
set replList
set name $xlateInVals
set newstr [string map $replList $name]
}
I can’t tell, but I assume there are spaces between values in replList
Also, I guess we do need to escape the } to keep Tcl from getting confused
Works for me.
proc xlt_name {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
set replList
set name [lindex $xlateInVals 0]
set xlateOutVals
]
}
When you escaped the [ character, did you enclose it with curly braces?
hcitcl>set a “123[456”
hcitcl>echo $a
123[456
hcitcl>regsub -all {[} $a “” b
1
hcitcl>echo $b
123456
Thanks…
Tom Rioux
The Methodist Hospital
This is what I did:
proc xlt_rmvchars {} {
Here’s what’s going in:
NTE|2|RADTEST3|THIS [ WAS MEANT TO } HAVE ERRORS IN IT
and here’s what comes out:
NTE|2|RADTEST3|THIS
cee1cee9 cee1
I don’t see this when I run it on my system. I think you have something else going on
I’ll look into this in more detail to see if there’s something else configured in this Xlate, and let you know what I find.
Here’s the message coming out of the sending system (all identifying data has been altered):
MSH
hci_e2a and hci_a2e don’t have [ ] characters for translation.
You need to fix the translations.
-mh
The EBCDIC/ASCII map tables are in a file named hciStart.tlib
Make sure if you touch this file that you back it up first.
You can really muck up your system if you make a mistake.
You should probably contact support.
Or maybe Charlie can explain what needs to be done.
Thank you (and Charlie) for your insightful information, though.
