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
trimming a subfield
Kevin Crist
i have a subfield that sometimes exceeds the app limit of 15 characters, how would i trim off the right side if its > 15?
for example:
EMERGENCY DEPT VISIT to EMERGENCY DEPT
Thanks.
Find more posts tagged with
Clovertech
Comments
Tom Rioux
If all you want is the first 15 characters, regardless, then just do a string range:
set var "EMERGENCY DEPT VISIT"
set var [string trimright [string range $var 0 14]]
I added the the string trimright to get rid of any spaces that may result from the string range (as would be the case here).
Hope this helps...
Tom
Kevin Crist
Thanks Tom, works great. i have one question though for clarity...the string trimright you mentioned does that stop it at the space, for example when i tested:
EMERGENCY DEPT VISIT - i got EMERGENCY
THER/PROPH/DIAG INJ, IV PUSH - i got THER/PROPH/DIAG
CESAREAN SECTION NOS - i got CESAREAN
Jim Kosloskey
Kevin,
Make sure there is no other white space in the text (such as tabs or newlines) that can cause trimright to trim unless you specify the character set you want trimmed.
I usually specify " " if I only want to trim spaces.
Kevin Crist
i think we would prefer to be able to have the spaces in there. We have some procedures that have names:
THER ULT HEAD & NECK VES
THER ULTRASOUND OF HEART
THER ULT PERIPHERAL VES
I am worried if i trim it to first space and get THER, i am not sure that is enough description for the docs.
Jim Kosloskey
Kevin,
In many cases the receiving system does want to see the trailing spaces as that may mean something to them. So if tht is what you think will work best just use the string range.
However the trimright should not remove any trailing non white space characters as you appear to be experiencing.
Tom Rioux
Oops...sorry about that......Monday on a Friday type of day!
Kevin Crist
thats no prob. know the feeling all too well. got to work, thanks tom, jim.
System
Originally posted by Scott Folley
Are you doing this in the translate? The only reason that I could see those commands doing what you are referring to would be if you were doing this on a value in the translate that was internally being treated as a list. In that case you would want to grab the value as a list so that it doesn't split on the whitespace when accessed.