Oh...!!! You had to change the whole code... sorry about that...
************************************************************************************************
NOTE: If you want to quit now, I will understand. You've already helped me a lot. I owe you man!
************************************************************************************************
Now...
I am not really understanding the following statement:
"Note that the number summation is limited by DOS to just a little over 2000000000"
I have 2 possible meanings for that:
1) The total amount of numbers to be sum cannot exceed 2000000000.
or...
2) The result of the sum operation cannot be above 2000000000.
Regardless of which the correct answer is, I noticed that for the largest servers it is not showing the correct result... I have even had some negative numbers as a result...
If the correct answer is number 1, let me say that:
I will never, ever ,ever ,ever reach that number. Data on the left column is never repeated for more than 400 lines.
If the correct answer is number 2, let me say that:
The numbers in the right are nothing else than backup images shown in KBs. What I am currently doing is changing it to GBs (*/1024/1024) for easier reading. So I thought... if it could be done, for every number, at the begining of the process (before the sum)... that would solve the "large-numbers-not-supported" issue.
If you give me your email address, I can send you the real and complete list "svr_list_1.txt" along with the (currently java-processed) final list "svr_list_2.txt" for your better understanding. (the lists are waaaaay too large to post here and I do not kwow how to attach filers here... as a matter of fact, i do not even know if it possible to do so) (If you cannot (or do not want to) give me you email address, I can rather create a new email account, attach the files there, and give you the pass so you can access these lists)
In addition to this, I am attaching below the contents of my current "my_precious.html" javascript (which works perfectly, only that I now need to do it all in Batch) so you can have a better idea of what I need:
Code: Select all
<html>
<head></head></br><text><b>Paste the contents of the "svr_list_1.txt" file here,</b></text></br><text><b>then hit the "DO THE MATHS!" button:</b></text></br><body>
<textarea id="left" cols="55" rows="10"></textarea>
</br></br>
<button onclick="doIt();" >DO THE MATHS!</button>
</br></text></br><text><b>Grab the contents of this box, and save it as "svr_list_2.txt"</b></text>
</br><textarea id="right" cols="55" rows="10"></textarea>
<script>
function doIt()
{
var hLeft = document.getElementById('left');
var hRight = document.getElementById('right');
var sourceTxt = hLeft.value;
var preList = sourceTxt.split("\n");
var multiArray = new Array();
var outterIndex;
var resultArray = new Array();
for(outterIndex = 0; outterIndex<preList.length; outterIndex++)
{
var temp = preList[outterIndex];
var temp2 = temp.split(' ');
multiArray[outterIndex] = new Array(temp2[0],temp2[1]);
// hRight.value = hRight.value + multiArray[outterIndex][0] + ' ' + multiArray[outterIndex][1] + "\n" ;
}
for (outterIndex=0; outterIndex<preList.length; outterIndex++)
{
temporal = multiArray[outterIndex][0];
temporalSum = 0;
flag=false;
for (innerIndex=0; innerIndex<preList.length; innerIndex++)
{
if(multiArray[innerIndex][0]==temporal)
{
temporalSum = temporalSum + parseInt(multiArray[innerIndex][1]);
if (flag==false)
{
resultArray[outterIndex] = new Array(null,null);
flag=true;
}
}
}
resultArray[outterIndex][0] = temporal;
// temporalSum = (temporalSum / 1048576);
// resultArray[outterIndex][1] = Math.round((temporalSum/1048576)*100);
resultArray[outterIndex][1] = Math.round((temporalSum/1048576)*100)/100;
}
hRight.value = '';
for(outterIndex = 0; outterIndex<resultArray.length; outterIndex++)
{
if (hRight.value.indexOf(resultArray[outterIndex][0])==-1)
{
hRight.value = hRight.value + resultArray[outterIndex][0] + ' ' + resultArray[outterIndex][1].toFixed(2) + "\n" ;
}
}
}
</script>
</body>
</html>
Once again... thank you for all your dedication to my succcess!!! (Even though it is pretty obvious that you master the Batch arts, that code did not write itself alone, and I am completely sure it was not a "just-a-couple-of-minutes" task, not even for you, man!)