infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
converting T to AND
Roy Osumi
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
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
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.
Max Drown
Roy, do a search on the forum for help with that. If you can't find what you need, let me know.
Roy Osumi
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