0

I want to change the names of the headers/columns from a csv file which I am reading from. Also I want to add new columns/headers.

My code so far is:

namespace CSV_Adapter
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var reader = new StreamReader(@"C:\Users\mrk\Desktop\output.csv"))
            {
                var csv = new CsvReader(reader);

                //Read the Columns from CSV file
                csv.Read();
                csv.ReadHeader();
                string[] headerRow = csv.Context.HeaderRecord;
            } 
        }
    }

}
mrk
  • 99
  • 3
  • 12
  • https://stackoverflow.com/questions/42134421/dynamic-creation-of-columns-using-csvhelper Column Creation. – Riddell Aug 30 '18 at 09:01
  • I think you can refer the below Answers for your question:- [https://stackoverflow.com/questions/19520557/change-csv-file-column-name] [https://stackoverflow.com/questions/19520557/change-csv-file-column-name] – Bhupesh Aug 30 '18 at 09:01

0 Answers0