I need to print variable quantities of despatch labels from a list of data using mailmerge. The quantity of labels will vary dependant on number of boxes:

Initial file:
CUSTOMER ID NAME ADDRESS BOXES
ABC123 ABC Limited High Street 3

I can write code to multiply the lines so I get one line per label:
CUSTOMER ID NAME ADDRESS BOXES
ABC123 ABC Limited High Street 3
ABC123 ABC Limited High Street 3
ABC123 ABC Limited High Street 3

Any ideas of how to create a field with 1 of n for the label number? e.g. 1 of 3, 2 of 3, 3 of 3 for above example.