Counting elements in a data file

In this example line, each data element is separated by a ^ element delimiter. A different element delimiter, +, is used with the UN/EDIFACT standard.

PO1^000001^1^EA^^^VC^TEST^IN^000004~

When counting the elements, do not include the segment identifier, such as PO1. For example, the third element of a PO1 segment is the unit of measure. So, counting over three ^ in the PO1 segment, not including the PO1 segment identifier, the value in the third element is EA.