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
Replacing null fields
System
Originally posted by David Harrison
I
Find more posts tagged with
Clovertech
Comments
Tom Rioux
David,
The string map is apparently leaving a couple of fields blank. This way is a bit more cumbersome, but you can try this:
set lst "GT098193,,DM11191700,SURNAME,Forename,20011217,M,,,,,,PP"
set lst [split $lst ,]
set idxs [lsearch -all $lst ""]
foreach idx $idxs {
set lst [lreplace $lst $idx $idx ""]
}
set newlst [join $lst ,]
I'm sure someone has a smoother way of doing it but I hope this helps.
Tom Rioux
System
Originally posted by Chris Williams
String map will match the first occurrence of ,, and make the change. The next match begins with the first set commas AFTER the previous match. It does not back up and reinterpret the comma ending the first match. ",,,," is seen as two sets of commas, not three. That's why you're having to make two passes.
Cheers.
System
Originally posted by David Harrison
I was thinking along the lines of Chris's logic. I think it would be less long winded to just make another pass using string replace.
Many thanks for your suggestions,
Dave