Generation

generate functionWed, 18 Jan 2023

Read a csv with header on line 2 and input the data into an object

public static void ReadData(string filePath) { var reader = new StreamReader(File.OpenRead(filePath)); //reader.ReadLine(); var lineCount = 0; while (!reader.EndOfStream) { var line = reader.ReadLine(); if (lineCount == 0) { lineCount++; continue; } var values = line.Split(','); var data = new DataSet { Element = values[0], Sample = values[1], Value = float.Parse(values[2]), First = float.Parse(values[3]), Second = float.Parse(values[4]), Third = float.Parse(values[5]), Fourth = float.Parse(values[6]), Fifth = float.Parse(values[7]), Sixth = float.Parse(values[8]), Seventh = float.Parse(values[9]), Eigth = float.Parse(values[

Want to kickstart your project?Use the new AI Studio to create your code