Hi guys im having a lot of problems trying to code. I have opened a csv file and have read it using strings.I have splitted the strings by the ','.
I want to load each of these values into a 2 dimensional array! but im having problems. Ultimatly i want to load all the values into an array and then sum the rows and find the averages.
So far ive managed to get the values into an ArrayList. Ive tried converting the ArrayList to an Arry i keep runnig into problems. Any ideas or help at all would be helpful.Thank You
So far my code reads like this:
public static void Main(string[] args)
{
string line = System.IO.File.ReadAllText(@"C:\Users\40025634\Desktop\Project\TEST FILE.csv");
ArrayList splitlinearray = new ArrayList(line.Split(','));
Console.WriteLine("The ArrayList contains the following values:");
PrintIndexAndValues(splitlinearray);
}
public static void PrintIndexAndValues(ArrayList splitlinearray)
{
int i = 0;
foreach (Object o in splitlinearray)
Console.WriteLine("\t{1}", i++, o);
while (true) ;
}
}
}
Thanks very much guys.