• You could build the header and trailer separately from the detail rows. Then append the files together.

    You can write a file as delimited or fixed width with multiple fields. Then read it using a different connection manager as a very long ragged right row with only one field.

    Another possibility is to build the output row as one long field as you go. First write the header, then the details (appending to the previous file), then the trailer (appending to the previous file).