Can I ask if I could also take a look at how you get the average of the ratio values as well?
Sure, here it is both makeRatioAvg and makeFinal
As you might guess, makeRatioAvg and makeFinal is still me following closely the pencil and paper moves -- didn't want to get lost :) Now I have reference program with reference test data, so if I get ambitious and try to combine makeRatioAvg+makeFinal I will notice easily when I make mistake :)
Another question, when splitting the data (by tab since its tab delimited file), it will be split according to columns right (downwards). Is it possible to split by rows (horizontal)? Will that be easier for this kind of ratio thing or it doesn't make a difference?
I'm not quite sure what you mean, but I doubt it makes much of a difference, here is why
rows are lines ... each lines consists of tab seperated values (columns of a row) , so you're already doing what is possible in the most straight forward way
the only issue I saw with your code is you had "while while" loop, where the outer while was used just for the header ... I wrote that as
It was called from DoWorkOriginal
Where sub monkeyBusiness is the foreach loops from your code which I didn't understand
The general strategy when I don't understand why/how something works, before I can begin to debug/improve, is to isolate/sequester everything into subroutines, and make sure it produces same output as original
|