I would like to create a counter in data-mapper that reference a field in .csv data file.
The data file has a field that has the total number of pages (field name=RegPoP) that need to print e.g 500. however the data file will only have 5 records.
The design template is a static PDF and needs a counter to run from 00001-00500 in this example case. The number of pages vary per district but but the concept it the same.
So if the RegPop has a value of 1100, then the counter should read 00001-01100. Note that the data file will then only have 11 records (new user so unable to upload sample data file)
I am not sure I understand your request. You are talking about pages and records and copies, and it’s a bit confusing. Please clarify the following:
“The data file has a field that has the total number of pages” - Is this the total number of pages or of records for the entire job? (a record may generate multiple pages)
“The design template is a static PDF” - Does the PDF contain multiple records or is it a single record? Or does each record in the CSV data file refer to a different PDF?
Here’s the way I think I understand it
The data file is a CSV that contains a certain number of records.
Each record refers to a static PDF (that may have multiple pages)
Each record has a field (RegPoP) that contains… uhm … the number of copies of that PDF that should be printed for that record?
Even if you can’t upload a data sample, please explain a little bit more about what you’re trying to achieve.
** The data file has a field that has the total number of pages ” -
Is this the total number of pages or of records for the entire job? (a record may generate multiple pages)*
Example:
The CSV data consists of 5 records only. Also, there are 14 columns in the CSV. The 5 records essentially have the same data across the 14 columns and only column (Box Barcode) changes every 10 records. (This is not important to this request but just so you know that the data is rather limited)
One of the columns (RegPop) has a value of 500. Again, same value in the RegPop column across the 5 records.
This means that if the data has 11 records, this RegPop will have value of 1100.
So by this we can see that it’s essentially x100 of the total records in data.
**** “ The design template is a static PDF ” - Does the PDF contain multiple records or is it a single record? Or does each record in the CSV data file refer to a different PDF?***
The PDF is a 2 page static PDF which will print duplex. We can use any generic PDF for this as the PDF is not really that important.
Each side will have same counter starting from 00001 ranging up to the RegPop value. So in this example of 5 records, the counter should read 00001-00500.
in the case of an 11 record data file, with RegPop having value of 1100, the counter will read 00001-01100.
So what I am trying to create is a script that will start a counter from 00001 and range up to the value in RegPop.
If I can share the data file, this will make this a bit easier to grasp