string trim component separator

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf string trim component separator

  • Creator
    Topic
  • #54561
    Dustin Sayes
    Participant

      Hello,

      The string :  |=^5.0|

      This is OBX 5. The generating application adds the “=^” before the value that we need, “5.0”

      I am using xltp

      set xlateOutVals [string trimleft $xlateInVals “=^”]

      The OutVal becomes |5.0^5.0|

      The echo on $xlateInVals shows “= 5.0” *note the ^ is missing

      when i echo $xlateOutVals shows ” 5.0″ *note a space where the ^ was

      and the final result, in the message is |5.0^5.0| in OBX 5

      Why is it giving me that output? I assume it has something to do with the component separator being a control character? What can I do to get around this?

    Viewing 2 reply threads
    • Author
      Replies
      • #81969
        Keith McLeod
        Participant

          Try using a backslash in front of those characters.

          =^5.0

          Are you just trying to get rid of the second component?

        • #81970
          James Cobane
          Participant

            Dustin,

            A couple of issues –

            1) because you have the value =^5.0 in OBX:5, the engine will see = in the first component of OBX:5 and 5.0 in the second component of OBX:5 because the ^ is the component separator.

          • #81971
            Dustin Sayes
            Participant

              Thanks for the answers.

              I ended up doing something similar

              @null -> 1(0).1(0).1(0).OBX(0).#5(0).[1]

              Copy 1(0).1(0).1(0).OBX(0).#5(0).[1] -> 1(0).1(0).1(0).OBX(0).#5(0)

              thanks again.

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