Append at end of last subfield in XLate

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Append at end of last subfield in XLate

  • Creator
    Topic
  • #50750
    Marcus de Leon
    Participant

      Hi,

      Can anybody tell me the best way to append .br at end of the last subfield in OBX5. My problem is that it seems to always replace the first subfield. I could do an iterate, however I’m not sure how to get the last subfield value in %f1.

      Below is what I’m doing, but it doesn’t work how I would like it.

      Code:

      CONCAT

      Source:
      =.br

      Destination:
      0(0).OBX(%s1)#5

    Viewing 1 reply thread
    • Author
      Replies
      • #67375
        Greg Eriksen
        Participant

          Not sure if this is what you mean, but I think what you are looking for is something like this?

          Destination:

          0(0).OBX(%s1)#5.[6]

          The PID.5 field (in the variant I pulled up) has 7 component fields, the last of which is named Name Type Code.  So if you want to insert the escape for a line break in the seventh component field, you would specify it with “.[6]”.  Remember, the counting is zero-based, so the 7th component field is number 6.

        • #67376
          Tom Rioux
          Participant

            You are using the concat command but only have one source specified.  If you are attempting to put an .br between each OBX.5, then try something like:

            Code:

            CONCAT

            Source:

            ~0(0).OBX(%s1)#5

            =.br

            Destination:

            0(0).OBX(%s1)#5

            You will need some tcl code to check if it is the first iteration or not (in which case ~0(0).OBX(%s1)#5 will be blank).  

            Tom Rioux

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