It is necessary to read with the help of StreamReader a .csv file. There are a lot of lines in the file. Each line has five values separated by commas. I use for this
private void button1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "Cursor Files|*.csv"; openFileDialog1.Title = "Выберите ранее записанный график в формате .csv"; if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { System.IO.StreamReader sr = new System.IO.StreamReader(openFileDialog1.FileName); data1_read =sr.ReadLine(); string[] slist = data1_read.Split(','); sr.Close(); data_temp_in.Add(slist[0]); foreach (var temp_in in data_temp_in) { MessageBox.Show(Convert.ToString(temp_in) + ""); } } But, as I understand it, I read only the first line, since there are no other values in the MessageBox . (only a zero value appears, which was read from the file).
How can I count columns from a file with multiple rows, add them to the Collection and then build a graph from this collection?
It used to be easier - we have two arrays. One is the values of X, the second values of Y, and everything, on the basis of these data we build a graph, but here it is not clear at all.