You can loop through the rows and write to file and name it ending in .csv
Basically you want the csv file to look like this:
"Field Name 1", "Field Name 2", "Field Name 3"
"Data 1", "Data 2", "Data 3"
"Data 1", "Data 2", "Data 3"
"Data 1", "Data 2", "Data 3"
"Data 1", "Data 2", "Data 3"
etc