You might want to try a different approach. From the example you gave of Total Physical Memory, I'd say you want to parse the file in to keys ("Total Physical Memory") and values ('xxxxxxxx'). When you find the keyword that you're interested in, you can print it out.
If I'm on the wrong track then can you provide an example of an actual input file and what you'd like to output?
I'd be looking for the words 'Total Physical Memory:' and then, by parsing that line, I'd need some code that could detect an 'int' (or a 'long'?) that was formatted as if it was the number representing the Total Physical Memory.
In effect, the code would have to know, based on the words 'Total Physical Memory' that the following numbers should be placed into an int/long for later usage in the program.
I guess it would be something to do with the getLine function but I'm not sure how to specify the specific 'word' (or number, really) that the code would have to extract from that line and place into an int/long.
Unless you have a line in the file that contains only the word "Number", the condition on line 23 will never be true and line 25 will never be reached. Since the file is never closed, the condition on line 17 will never be false if it was ever true.