Extra Carriage Return

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Extra Carriage Return

  • Creator
    Topic
  • #48537
    Ken Seachrist
    Participant

      I have a transaction where I had to add two segments, and remove 3 others.  The final segment is an OBX, which is in the original message.  I am manually manipulating the indices for the segments in the TCL proc to have them where I want.  But now, I am getting an extra CR at the end but no line feed.  Is there a simple command to remove a CR at the end of a message and add a line feed?  Thanks in advance for any help you can provide.

    Viewing 4 reply threads
    • Author
      Replies
      • #58920

        In Tcl you could try something like this …

        Code:

        regsub 15$ $currentMsg 12 newMsg

        … where 15$ is (octal) carriage return at the end of a line and 12 is (octal) line feed.

        Or, if you have perl installed, you could try this from within Tcl …

        Code:

        [catch {exec perl -e “$_ = “$currentMsg”; “s/15/12/”; print”} newMsg]

        You will probably need to tweak this for your actual needs and your specific environment.

        -- Max Drown (Infor)

      • #58921
        Ken Seachrist
        Participant

          I tried that method using both octal and hex and neither worked.  Is there something that would prevent that change since the characters are at the very end of the message?  I would think there would be a simple way in TCL to go to the very end of a message, remove 1 character, and replace it with another character.

        • #58922

          Could you post or attach a test message here please?

          -- Max Drown (Infor)

        • #58923
          Charlie Bursell
          Participant

            regsub — {rr} $msg {rn} msg

          • #58924
            Ken Seachrist
            Participant

              I tried to get  it copied from the Hex editor, but that didn’t work.  I also couldn’t get it into Notepad.  What I can tell you though is that there are double CR at the end of each message.  I have been doing some research and it may be coming from the sending application.  Thanks for your help though.

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