Splitting up a field

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Splitting up a field

  • Creator
    Topic
  • #52380
    Tim Pashon
    Participant

      Hopefully this is and easy one (and probably is).

      I have a date and time field, format YYYYMMDDHHMMSS, on the input and want break it apart in the xlate into seperate fields:

      YYYY

      MM

      DD

      HH

      MM

      SS

      Is there a way to substring the field starting at position X for length Y?

      Thanks!

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

          set yyyy [string range 0 3 $datetm]

          set mm [string range 4 5 $datetm]

          etc (I think you get the idea) should do it.

          where: $datetm is the original date/time data.

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

        • #73982
          Tim Pashon
          Participant

            Thanks so much.  I knew it was there somewhere just couldn’t find the right syntax.

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