How big will the files you need to be, typically? How many rows, how many characters in a long one?
Will all of the data be available before you need to do the write-to-file, or are records coming in one at a time, over a long period, and writing them to the file, one at a time, as they arise best? (Like a system log file, for instance)
Even for quite big files, one approach would be to "assemble" the CSV file in a memo, and then use...
meYourMemo.lines.SaveToFile('YourCSV_file.txt');
...to save the memo to a file.
In the memo: Turn WordWrap off.
To look, in detail at what is in a file, use Textpad. Free evaluation copy from textpad.com Open the file of interest as "Binary", and you can see exactly what your program is doing to create new lines. EXPORT, FROM EXCEL, a small CSV file of some known data, and you can see what it expects to see for new lines.