Originally posted by Frank Urbanija
Originally posted by Levy Lazarre
Levy Lazarre wrote:Frank,A sample would be useful.What does the data look like when yyyy is blank? Is it xx--zzz or xx-zzz?
Levy Lazarre wrote:
Originally posted by Scott Folley
set inval1 [ lindex $xlateInVals 0 ]set inval2 [ lindex $xlateInVals 1 ]set testValue [ lindex [ split $inval2 "-" ] 1 ]if { $testValue eq "" } { set inval2 [ lreplace $inval2 1 1 $inval1 ]}set xlateOutVals $inval2
lassign $xlateInVals pv1_7_1 ft1_3# echo >>> pv1_7_1: $pv1_7_1# echo >>> ft1_3: $ft1_3# Check for the pattern "--" in FT1.3; that would indicate a missing part2# since FT1.3 should be part1-part2-part3if {[regexp -- {--} $ft1_3]} { # collect part1 and part3 of the string regexp (\w+)--(\w+) $ft1_3 all part1 part3 # echo >>> part1: $part1 # echo >>> part3: $part3 # Build our output by concatenating the appropriate parts with dashes # (Could also use a join command) # Always return xlateOutVals as a list set xlateOutVals [list $part1-$pv1_7_1-$part3]} else { # The string in FT1.3 came in complete. Nothing to do. set xlateOutVals [list $ft1_3]}