Here's my guess. You read the last data, then there is something else, like a carriage return and/or newline character before the end of file character. Then, it reads in that data, then it hits the end of file, however, it's already begun the loop. Then, since EOF causes isAlpha(), isDigit() and comparison to '-' to be false, none of the data is modified. As a result, you push the same data on twice. You could test this hypothesis by initializing the data at the beginning of each iteration of the loop.
First thing to do is check the test file and delete any addtional spaces at the end of it. If there isn't any extra characters, you could offset the reading like this, so it reads the next character at the end of the loop, before checking the EOF condition. Finally, you could only push the data if ws != EOF.
- Read 1st Param
-
while(infile != EOF)
-
{
-
Test 1st Param
-
Update 1st Param
-
-
Read 2nd Param
-
Test 2nd Param
-
Update 2nd Param
-
-
Read 3rd Param
-
Test 3rd Param
-
Update 3rd Param
-
-
Push Data;
-
Read 1st Param;
-
}