A method is provided for generating a variable data file to be used to generate
custom printed articles. A template including a plurality of tokens is read, and
a data structure including a plurality of printed article ID's is generated. A
record in a database is identified using a first printed article ID, and data is
extracted from a field of the record which is specified by a first token in the
plurality of tokens. The data is outputted to the variable data file. In a preferred
embodiment, an index is incremented to point to a second printed article ID in
the data structure in response to reading a second token in the template. Also
provided is a system for producing custom printed articles.