regsub help

  • Creator
    Topic
  • #47913
    Mike Delahunt
    Participant

      Hello everyone,

      CL3.8.1P

      HP-UX 11.x

      I am using the concat option within my xlate to copy a few fields into one  and when I echo $xlateInVals it looks like the following:

      {L A C} {NDS Corp} {30 Campion Rd} {} Utica NY 134920030

      When I look at the outbound message the field looks like:

      L A CNDS Corp30 Campion RdUticaNY134920030

      I need to seperate each element in the list with a ^ so that is look like:

      L A C^NDS Corp^30 Campion Rd^Utica^NY^134920030

      I tried using the regsub command with no luck, any help would be greatly appreciated!

      Thanks in advance!

      Mike

    Viewing 4 reply threads
    • Author
      Replies
      • #57067
        Bill Bertera
        Participant

          If you put ^ as the Seperator in the Xlate concat command, that should do it.

        • #57068
          Mike Delahunt
          Participant

            Bill,

            Thank you it worked perfect! I can’t believe I over looked that!

            Thanks again,

            Mike

          • #57069
            Jim Kosloskey
            Participant

              Mike,

              On the CONCAT Action there is a place to specify a separator you might want to use.

              Only problem might be if the HL/7 separator in the MSH changes you need to remember to change this.

              Why not simply COPY each element to the appropriate component of the receiving field and let the Xlate automatically insert the defined component separator. That way if the separator definition changes in the MSH you are covered dynamically. This would mean replacing the CONCAT with a number of COPYs.

              Jim Kosloskey

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

            • #57070
              Mike Delahunt
              Participant

                Hello Jim,

                I would have used the copy command for each but the destination field is set up as data type ST.

                Thanks,

                Mike

              • #57071
                Mike Delahunt
                Participant

                  Hello Jim,

                  You are correct, even though the receiving field is a data type ST I was still able to copy each element to a component of the receiving field and the Xlate automatically inserted the defined component separator.  Thanks for the info!!

                  Mike

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