Within TCL I am trying to split a flatfile message and each line ends in a CRLF

Clovertech Forums Cloverleaf Within TCL I am trying to split a flatfile message and each line ends in a CRLF

  • Creator
    Topic
  • #119337
    Tom Gilbert
    Participant

      Within TCL I am trying to split a flat file message and each line ends in a CRLF. Here is an example of what I am using ‘set segs [split $msg \r]’ for some reason it is showing an extra character when I get the length. Do I need to split on somthing else?

    Viewing 1 reply thread
    • Author
      Replies
      • #119346
        David Barr
        Participant

          Maybe you could get rid of the CRs first and then split on the LFs. Something like this:

          set segs [split [string map { \r “” } $msg] \n]

        • #119347
          Tom Gilbert
          Participant

            The above worked great… Thank you so much…:)

        Viewing 1 reply thread
        • You must be logged in to reply to this topic.