Field translation

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Field translation

  • Creator
    Topic
  • #53219
    Tim Pashon
    Participant

      Need some advice.

      I want to translate a field.

    Viewing 2 reply threads
    • Author
      Replies
      • #76958
        James Cobane
        Participant

          In the Xlate, you could do this type of tcl fragment as a pre in the COPY statement:

           set xlateOutVals

            X] 0]]

            This gets the value from xlateInVals, splits it on ‘X’, then values xlateOutVals to the 1st value from the resulting list (i.e. everything before the X)

            Hope this helps.

            Jim Cobane

            Henry Ford Health

          1. #76959
            Tim Pashon
            Participant

              Thanks!!!  Worked like a charm!

            • #76960
              Eric Fortenberry
              Participant

                This could also be done with Regular Expressions.

                This example would remove the first “X” and all of the characters to the end of the string.

                 

                Code:

                set xlateOutVals [list [regsub {X.*$} [lindex $xlateInVals 0] “”]]


                This example would remove the last “X” and all of the characters to the end of the string.

                 

                Code:

                set xlateOutVals [list [regsub {X[^X]*$} [lindex $xlateInVals 0] “”]]


                My guess is that you will only have one “X” in your values that you are processing, thus either of the above examples should work.

                Thanks,

                Eric

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