I need to split the obx.5 when I have a MIC sensitivity, so that I can take
Gentamicin, <=1, S and put them into seperate fields. The spacing from the rec. system is not allows consistent.
OBX|23|ST|CUL SS^Culture, Routine|| Gentamicin <=1 S|||
Thanks,
Chad
I’m no expert at tcl, but since no one else has replied yet I thought I’d give it a shot. There is probably a better way, but the following might give you some ideas:
hcitcl>set data ” Gentamicen <=1 S"
hcitcl>set list1 [split $data]
hcitcl>echo $list1
{} {} {} {} Gentamicen {} {} {} {} {} {} {} {} <=1 S
hcitcl>foreach element $list1 {
hcitcl>set source ” Gentamicen <=1 S"
Gentamicen <=1 S
hcitcl>set source [string trim $source]
Gentamicen <=1 S
hcitcl>
hcitcl>regsub -all — {s+} $source ” ” source
2
hcitcl>put $source
Gentamicen <=1 S
The regsub will take all concurrent spaces and convert them into one space. You can then split your data and get your 3 element list.
Steve