Counting
CsvPath Validation Language examples of counting CSV data
These examples show different ways to craft CSV and Excel validation rules for counting lines and header values.
There are a number of ways to do similar counts that have separate purposes but which overlap. For example:
increment()adds 1 each N times a match component evaluates to Truecounter()adds N each time a match component evaluates to Trueevery()adds 1 every N-times a value is seen, matching or not
Likewise, summing offers options:
sum()keeps a running count of values in a headercount()keeps a count of matches and, likeevery(), can also count match components it containssubtotal()tracks the running sum of a header for each value in another headertally()tracks counts of the values seen in headers or combinations of headers

Last updated