checking a string to see if it contains special characters

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf checking a string to see if it contains special characters

  • Creator
    Topic
  • #51642
    Doug Lundin
    Participant

      We are checking OBX.5 and trying to get rid of any special characters such as hex c2 and hex 95.  Tried this in the translation if statement and (ct) contains, but can’t seem to get it to work.  Any suggestions

    Viewing 2 reply threads
    • Author
      Replies
      • #71074
        Gary Atkinson
        Participant

          Check in a tcl proc before the translation.

        • #71075
          Jim Kosloskey
          Participant

            Or –

            If it is just OBX-5 that has the issue AND if they are not the character set defined in MSH-1 and MSH-2 you want to affect, you could use a xltp type Tcl proc inside the Xlate when COPYing the OBX-5 field.

            email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

          • #71076
            Charlie Bursell
            Participant

              set inp [lindex $xlateInVals 0]

              regsub -all — {[^x20-x7e} $inp {} inp

              set xlateOutVals

                # Gets rid of all non-printing characters

          Viewing 2 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.