- This topic has 3 replies, 3 voices, and was last updated 15 years, 1 month ago by .
-
Topic
-
i have a tclproc that separates the order number is ORC and OBR 2 at the underscore. I just found out that the first set of numbers before the underscore can be either 6, 7, or 8 digits. How do i split that with the number varying so that i can put the number with the L in ORC2 and the number before underscore in the ORC3. #########################################################################################
# Split the order format 999999_L12345-1 into two numbers 999999 and L12345-1
# and put orchard number in ORC2 & OBR2 and the Affinity order number in ORC3 & OBR3
#########################################################################################
set ORCList [split [lindex $segList $ORCpos] $fldSep]
set num1 [lindex $ORCList $ORCorchNum]
set orchNum [string range $num1 0 6]
set affiNum [string range $num1 8 15 ]
#echo orchNum: $orchNum
#echo affiNum: $affiNum
set OBRList [split [lindex $segList $OBRpos] $fldSep]
set num2 [lindex $OBRList $OBRorchNum]
set orchNum2 [string range $num2 0 6]
set affiNum2 [string range $num2 8 15 ]
lset ORCList $ORCorchNum $orchNum
lset ORCList $ORCaffiNum $affiNum
lset OBRList $OBRorchNum $orchNum2
lset OBRList $OBRaffiNum $affiNum2
lset segList $ORCpos [join $ORCList $fldSep]
lset segList $OBRpos [join $OBRList $fldSep]
msgset $mh [join $segList r]
- The forum ‘Cloverleaf’ is closed to new topics and replies.