How to count elements in a data file

In the example line below, 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, you 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.