Originally posted by Jon Melin
Hello. Still learning Cloverleaf so hopefully I can find some additional help here. I am looking to strip zeros off the front on of an ID (that's always 8 digits long) but I also need to add dashes in the format of [ xxxx-xxx-x ].
So it comes in as an ID of 000XXXXXXXX and I need to change it to XXXX-XXX-X. Currently I have written a small amount of TCL within my XLT to add zeros:
Like this:
set ptInVals [lindex $xlateInVals 0]
# Format PID.3 to always be 11 digits, Right justified, zero-filled
set xlateOutVals [list [format "%11s" $ptInVals]]
But I need to go the opposite direction and add dashes at those specific increments. Please let me know if you have any suggestions.
Thank you,
Jon