Hi Guys,
I have a file which contains the following info (it realtes to CPU usage):
1 0 2 2
0 10 1 11
It is stored in a text file. I need to read each line in turn into an array and then import it into a sql database. I know how to read a line into an array but i want each number to be seperate elements in the array. So the code would read line 1 (1 0 2 2) and create an array with four seperate values do something ething else then go back and read the second line.
I know how many lines are in the file by looking up some info in my database (NoDisks) as there could be up to 30 cpus on one system so the code i have so far is this:
for (int i = 1; i<= NoDisks;i++)
{
StreamReader sr = new StreamReader(fileName.FullName);
ArrayList arrText3 = new ArrayList();
string line = sr.ReadLine();
arrText3.Add(fileName.LastWriteTime);
importCPU(serverID, arrText3, dataConnection);
}
it only reads the line into the array one at a time i think i need to get it read the line and then seperate via the spaces but i cant work it out. Any help?