X12 – TCL PROC

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf X12 – TCL PROC

  • Creator
    Topic
  • #48468
    Femina Jaffer
    Participant

      I am trying to modify an existing TCL proc that manipulates an X12 transaction.

      I need to append the ISA header to each TRN and then break it into separate files.  I am having a problem with getting the data between the ISA header and everything before the ~TRN, and then setting this to a variable.  Any advice would be most helpful and appreciated.

      Thanks

      FJ

    Viewing 1 reply thread
    • Author
      Replies
      • #58706
        Charlie Bursell
        Participant

          # I am not big on *ASSUMING* sep characters

          set elSep [string index $msg 105]      ;# Normally ~

          # get the header (ISA … ~) Just before TRN

          set head [string range $msg 0 [string first “${elSep}TRN” $msg]]

          # Remove header from message

          set msg [string replace $msg 0 [string first “${elSep}TRN” $msg]]

          Hope this helps

        • #58707
          Femina Jaffer
          Participant

            Thanks Charlie!  I will give this a try.

            FJ

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