How to replace .br with a carriage return within an xlate

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How to replace .br with a carriage return within an xlate

  • Creator
    Topic
  • #54089
    Henry Bauer
    Participant

      I have a problem with 2 items I am not as conversant with as I would like to be Xlates and regsub. I need to replace a .br with a carriage return using the regsub command, all in OBX segments, or use string map?. there is already some code in place for the field OBX 5 I am tasked with adding this component to a previous owners Xlate.:

      set input $xlateInVals

      set text “DOCUMENT ELECTRONICALLY SIGNED IN CHARTMAXX ~TRANSMITTED OUT OF CHARTMAXX AT “

      # Variables OBX_11 and MSH_7 was assigned values earlier in the xlate

      regsub -all {} {} $input {~} output1

      regsub -all {{} $output1 {~} output2

      regsub -all {}} $output2 {~} output3

      if { $OBX_11 == F } {

    Viewing 1 reply thread
    • Author
      Replies
      • #80118
        Jim Kosloskey
        Participant

          Henry

          Are you sure you really want to do this?

          Won’t this place erroneous hex 0d characters inside segments causing the receiving system’s parser to have issues?

          If the receiving system insists on this and it were me this is one of the things I would do in the outbound TPS just before the message is delivered so I would not run into erroneus segment termination issues inside Cloverleaf.

          In either case I would use string map rather than regsub if I had to code rather than use existing code.

          But maybe what they want is new-line (hex 0A). In that case I would also use string map but I would more confidently do that inside the Xlate.

          It would be best to be sure what exactly they want and can handle.

          However, since you need to morph this into already existing code I suspect I would simply apply the string map against the variable output4 just before xlateOutVals is set or as part of setting xlateOutVals.

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

        • #80119
          Henry Bauer
          Participant

            Thanks for the response Jim I did not consider that. I appreciate the input.

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