Monday, February 2, 2015

Dump Dates to CSV File - C#

#region Dump Output Dates to File

string filePath = "c:/dev/projected_dates.csv";

string actualDatesCSV = string.Join(",",
 actualDates
 .OrderBy(x => x)
 .Select(x => x.ToShortDateString())
 );

using (var sw = new System.IO.StreamWriter(filePath))
{
 sw.Write(actualDatesCSV.Replace(",", "\n"));
}

#endregion

No comments:

Post a Comment

comment: