This is your homework - so I won't give you the code.
I wouldn't bother with a StreamReader:
string[] lines = File.ReadAllLines(pathToFile);
Will do it fine. You can then use a
foreach
loop to process each string.
Inside the loop, set up a thread (a BackgroundWorker is probably the easiest way) to process each line.
In the thread use string.Split to break the line on each comma:
string[] parts = line.Split(',');
You can then use int.TryParse on each string to convert it to a number.
You can then work out the vector sum and return it to the main thread.
The main thread assembles all the sums, aggregates them in a collection, sorts the collection, and writes them to the new file.
Do it a bit at a time, and it's all pretty simple stuff!