Exporting CSV with different number of columns in rows

I am trying to export a CSV where the Header row has fewer columns than the rest of the file. Also for daylight saving, one day a year will have two fewer columns than the rest of the month.

How can I remove the trailing commas in the exported file?

You can reimport the file using the “Import plain text” action, remove the trailing commas, and then export the result back using the “Export plain text” action.

If the number of commas differs from row to row, you can use the technique described here: Treat consecutive delimiters as one