This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var csv = Util.ToCsvString(data); // Convert the data to CSV format | |
// Save the CSV data to a file | |
var filePath = @"C:\dev\file.csv"; // Specify the path and filename for your CSV file | |
using (var writer = new StreamWriter(filePath, false, Encoding.UTF8)) | |
{ | |
writer.Write(csv); | |
} | |
Console.WriteLine("Data exported successfully!"); |