I am making a process that runs daily. At the end of the run, there are a number of records that need to be written into a CSV file. This CSV file groups all resulting records for that month. During a data process step that combines the individual records into the batch that will be written to the file, I can either select to retain or remove the header. The batch is then written to a file connector, with "Append when file exists" selected in the operation.
The file that we need to output needs to have the data header. At the end of the month, it is sent to a printing queue, and the headers determine a number of fields in the letter that is printed. However, when retaining the header in the data process, the data header is repeated in the resulting file every day the process runs. This results in a number of letters being printed for: "Name Surname, Address, ZipCode Town"
Is it possible to only retain the header when the file does not exist? Or is there any other way around this problem?