I faced that situation quite a while ago.
Back then, I created a calculated CSV "field" in a single column to the right of the data area and copied the values to a separate sheet in the workbook. The formula built each CSV row according to the spec required for the receiving program. Some rows had fewer fields than others. When done, I exported that calculated sheet to a CSV file.
That formula looked something like this:
=A1&","&B1&","&C1&IF(Sheet1!D1<>"",","&Sheet1!D1,"")
Is that something you can work with?
Bookmarks