I hope this is easy. I’m trying to count the number of times a specific segment occurs in my HL7 message. It’s variable and I will use this value for a for loop variable later in my uproc.
I can count the number of elements by
set segmentList [split $msg r]
set elements $segmentList
set j [llength $elements]
Now, I want to see how many of those elements begin with ZTX and return that as a number.