converting T to AND

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf converting T to AND

  • Creator
    Topic
  • #52982
    Roy Osumi
    Participant

      I have a system that is sending me T and I want to replace it with AND.  The issue am having is there are sometimes spaces before and/or after the T and sometimes no spaces.  I am having difficulty formatting my output correctly.  This T can occur anywhere in a description.

      examples and expected outcomes

      STI = S AND I

      S T I = S AND I

      ST I = S AND I

      WITH TWITHOUT CONTRAST = WITH AND WITHOUT CONTRAST

      if I use string map on the above examples I would get output like this

      set a [string map “\T\” “AND”]

      output would be:

      SANDI

      S AND I

      SAND I

      Where S AND I is the correct output.  What is an efficient way to program this so all examples have the correct output?

      using CL 5.5 linux 4.0

    Viewing 2 reply threads
    • Author
      Replies
      • #76162
        Jim Kosloskey
        Participant

          Roy,

          Well I am guessing the message is using the default su-components separator (&) and thus the T should be replaced by &.

          The original formatting of the text was done using & not AND thus the spacing, etc. was proper.

          The intent is to replace T with & I suggest you do that and now the text will look as intended.

          However, I am guessing the receiving system does not know what to do with the T and the & will cause it problems.

          So I tried this and it seems to work:

          set a [string map

            $b]

            I am assuming your value to be mapped is in the variable b above.

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

        • #76163

          Roy, do a search on the forum for help with that. If you can’t find what you need, let me know.

          -- Max Drown (Infor)

        • #76164
          Roy Osumi
          Participant

            Sorry Jim –

            I wrote a reply but I guess I did not send it.  Jim was really close.

            To get the format correct I needed to add in the space before and after the  ” AND ” for every scenario.

            set a [string map

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