I am trying to write into a csv
file row by row using C# language. Here is my function
string first = reader[0].ToString();
string second=image.
Instead of calling every time AppendAllText()
you could think about opening the file once and then write the whole content once:
var file = @"C:\myOutput.csv";
using (var stream = File.CreateText(file))
{
for (int i = 0; i < reader.Count(); i++)
{
string first = reader[i].ToString();
string second = image.ToString();
string csvRow = string.Format("{0},{1}", first, second);
stream.WriteLine(csvRow);
}
}