Trimming sapces from end of VRL field

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Trimming sapces from end of VRL field

  • Creator
    Topic
  • #54601
    Mike Keys
    Participant

      Don’t know if this is a case of the Monday’s but struggling with a simple (or what should be) snipped of Tcl code in an xlate.

      We’re on 5.7, so what I am attempting to do is trim up fields from a VRL in an XLATE that copies these to an HL7 message.

      In my Pre Proc tab, I have the following:

      set xlateOutVals [string trimright $xlateInVals x20]

      I used the x20 as this is what the hex editor shows

      Am I on the right path. I thought trimming up white space from a field would be easier than this.

      Mike Keys

    Viewing 4 reply threads
    • Author
      Replies
      • #82183
        Mike Keys
        Participant

          Nevermind…fixed it.

          set xlateOutVals [string map -nocase {” ” “”} $xlateInVals]

        • #82184
          Jim Kosloskey
          Participant

            Mike,

            I would use the string trimright command.

            In either case please remember xlateOuVals is  a LIST so use aomething to make it a list (like the LIST command).

            email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

          • #82185
            Jim Kosloskey
            Participant

              I shoulld have included xlateInVals as well and given the source has spaces (white noise) I suspect your issue has more to do with not treating xlateInVals and XlateOutVals as lists than the code you are using.

              email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

            • #82186
              Mike Keys
              Participant

                Jim,

                I tried string trimright using lists and still couldn’t seem to make it work.

                Mike

              • #82187
                Jim Kosloskey
                Participant

                  Mike,

                  Email me and I will send you a proc we use to do thee string trim.

                  You can use that to see if you are doing the same thing any differences are possibly what you need to adjust.

                  Or ypu coulld just use the proc I send you as is  🙂

                  email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

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