Do you know what a CSV file looks like internally? If so, what would you have to do in order to create such a file?
Of course, if you have just a single value in each row, then there isn't much difference between a non.CSV text file and a CSV file.
Lastly, if the data that's supposed to go into the CSV gets more complicated, then
you should consider using a library for creating such files - the format does get more complicated to generate if you can't make any assumptions about its contents. The
AccessingFileFormats page links to several available CSV libraries.