02-27-2020 10:30 PM
I have 3 binaries as three documents. Is it possible to merge the three binaries into a single document and write it to a file?
03-02-2020 02:08 PM
I’ll give this a shot. My concern is that the header, detail, and trailer records all have different numbers of columns. 2 - 40ish - 3
03-02-2020 02:16 PM
So close. I got close to this point last week. What happens when you have different numbers of columns when using a CSV formatter, it adds additional columns to the front of each detail and trailer row. The CSV formatter doesn’t like different numbers of columns
03-02-2020 02:50 PM
What are the contents of the header and trailer? Are they valid CSV rows or plain text?
03-02-2020 02:52 PM
The header is 2 columns (no actual header) - record_type and description. The trailer is 3 columns (no actual header) - record_type, number of detail rows, and end of file field. There can be N number of detail records. They all start with record_type column and then have ~40 columns. The header and trailer rows are also pipe-delimited.
03-02-2020 03:00 PM
The pipeline you shared above gave me an idea. I tested it and it looks like it will work for what I need to do, although I still need to figure out how to get the total number of detail rows to put in the trailer.
Get your header/details/trailer → CSV format however you need them → Bin2Doc → Join Merge → Mapper (Base64.decode($content).concat(Base64.decode($detail_content), Base64.decode($trailer_content))) → DocToBin → File Writer
I don’t believe that this is the most efficient way of accomplishing this task but it looks like it will work. What do you think @tstack?