You can specify a blank value as the loop break condition
<loopbreakcondition>
<rowcheck offset="0">
<cellcheck offset="0"></cellcheck>
</rowcheck>
</loopbreakcondition>
This will loop until it finds an empty cell as the first cell (offset=0
on cellcheck
) in the next row (offset=0
on rowcheck
) after the last valid pass. You can use the offset
attributes to change what cell or row cannot be blank.
A rowcheck
element can contain any number of cellcheck
elements. In my case none of the cells in the input Excel were mandatory, so I specified a blank cellcheck
element for each cell in the row.
Example (assuming there are 3 cells in a row)
<loopbreakcondition>
<rowcheck offset="0">
<cellcheck offset="0"></cellcheck>
<cellcheck offset="1"></cellcheck>
<cellcheck offset="2"></cellcheck>
</rowcheck>
</loopbreakcondition>
Meaning:
Stop looping if all of the cells in the next row are empty.
In the case you would have some cells required to be not blank, you could simplify the above break condition by only including the required cells.
Example (assuming there are 3 cells in a row and the last cell is mandatory)
<loopbreakcondition>
<rowcheck offset="0">
<cellcheck offset="2"></cellcheck>
</rowcheck>
</loopbreakcondition>
Meaning:
Stop looping if the third cell in the next row is empty.