I think there have been no answers to this because no one really knows what you have in FileMaker exactly, nor what you want in the csv exactly. We could guess, but likely incorrectly.
I'm pretty sure (tho without knowing) this will need another table, to temporarily hold the rearranged values, which you could then Export, then delete. With a script to go thru your existing values to create the temp records, and populate the fields.
Or just calculations to assemble the values. But I somehow doubt that. When you say "problem with carriage returns", do you mean "I have fields with internal carriage returns which get changed when I Export CSV"? or "The output has too many or too few carriage returns (too many or too few rows)"?
Made another table pasted the fields with script loops into a single record and it exports perfectly and gives me greater control over sorting and re-numbering.
Works well now.