Hi,
I have a pipe delimited flat file database of students that I mail out certificates to.
I wrote a label preparation script which basically passes through the file and prepares a mailing label from each record with a reference for which certificate to enclose (also from the database). (Happy to share this if anyone wants it).
Thing is that I get a label for each certificate when I could put up to 4 certificates in a single mailing - at the moment I'm just not using three out of four labels.
I am therefore looking to add a subroutine that loads the database and appends up to four certificate references into each student's field (and remove the records that it appends), just before the labels are printed. There can be up to 3,000 records in the database on heavy days but this is unusual, there are normally more like 500.
The database is like this:
ID|Name|Address |CertRef|Date
345|Paul|13 Somwhere|CG6129 |100707
387|Steve|15 Somwhere|CG6129 |100707
345|Paul|13 Somwhere|CG6089 |100707
After the routine I need a database (can be a new file) to look like this:
ID|Name|Address |CertRef|Date
345|Paul|13 Somwhere|CG6129 CG6089|100707
387|Steve|15 Somwhere|CG6129 |100707
I am assuming that I need to slurp the contents of the database into an array but I would appreciate help on the code to look for matches, append and delete.
Please ask if you need any more info. Many thanks.
Paul
I have a pipe delimited flat file database of students that I mail out certificates to.
I wrote a label preparation script which basically passes through the file and prepares a mailing label from each record with a reference for which certificate to enclose (also from the database). (Happy to share this if anyone wants it).
Thing is that I get a label for each certificate when I could put up to 4 certificates in a single mailing - at the moment I'm just not using three out of four labels.
I am therefore looking to add a subroutine that loads the database and appends up to four certificate references into each student's field (and remove the records that it appends), just before the labels are printed. There can be up to 3,000 records in the database on heavy days but this is unusual, there are normally more like 500.
The database is like this:
ID|Name|Address |CertRef|Date
345|Paul|13 Somwhere|CG6129 |100707
387|Steve|15 Somwhere|CG6129 |100707
345|Paul|13 Somwhere|CG6089 |100707
After the routine I need a database (can be a new file) to look like this:
ID|Name|Address |CertRef|Date
345|Paul|13 Somwhere|CG6129 CG6089|100707
387|Steve|15 Somwhere|CG6129 |100707
I am assuming that I need to slurp the contents of the database into an array but I would appreciate help on the code to look for matches, append and delete.
Please ask if you need any more info. Many thanks.
Paul
Comment