As wrenches must be thrown with great aplomb, it only seemed appropriate for this one. One data file into data processing. They’ll give the original file, with a quick fix here and one row per detail item, as well as a CASS/PRESORT file with one row per letter. Of course, these two files are four files, but the process is the same. I have a few options, but none of them is seeming great.
- I drop the detail in to PReS Connect’s data repository (ghetto SQL). I then load the mail file, and pull in individual groupings of data. Hmm… This might be better than I thought, as I could just dump in the transactions parts as one big string and then split it in the actual content creation.
- Dump both files into xml, merge them both together with an xslt, and remap the xml. This won’t be bad at all, as we’re already setup to use a detail table. For line sizing (really long details) this would be already ready to work. I should try making the said xml files, and see if I can get away with this. Also, not mucking with the repository makes me happy.
- Load the two days files as strings in JavaScript. Use the sorted one to search the detail one. Map the new detail one.
- See if I can sort data by an outside key. Without the repository that is.
As a plus note, every time I spend a few minutes teaching my coworker something, it totally makes more sense to me. I knew having an infinite amount of trivial knowledge would help someday. This last sentence was a lie.
Update:
While I haven’t actually done this yet, I think this will be the cleanest way. CSV mapped to XML, converted to JSON for each file. Combine the two together. Convert backish to XML. Map to established layout.
No weird external scripts, xslt files, or manual ministrations.
Further update (technically Friday’s):
The csv-xml-json-xml ploy wasn’t working.
External data sources are still a headache (if have to install stuff, which means contacting IT).
Resorted to doing the post into a repository, pull out back out. Took a little time to troubleshoot. One, some if the data I got was bunk. Two, and this one is just silly… Deep breath. I map the mailing data. From there I have the key, which is used to run a query from the repository. I push the repository data into a metadata variable visible to the template. But, the metadata is off by one record. First record has nothing, second has the first’s data, etc. All because I didn’t check the check box that said update the metadata…
Now I know I could do that, it’s cool and all, but really… Oh hey, I could totally abuse that for those payment coupon books.